1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-17 01:12:45 +02:00

Refactor configs (#1882)

* trace: Refactor sampling config

* tracer: Refactor TracerProviderConfig

* Update the changelog

* Refactor sdk/metric/controller/basic config

* Refactor sdk/metric/processor/basic config

* Refactor sdk/resource config

* Refactor oteltest config

* Refactor exporters/otlp configs

* Refactor exporters/stdout config

* Refactor exporters/trace/jaeger configs

* Refactor exporters/trace/zipkin config

* Unexport stdout.NewConfig

* Refactor zipkin.go

* Refactor provider.go
This commit is contained in:
Robert Pająk
2021-05-14 22:28:28 +02:00
committed by GitHub
parent 6324adaa66
commit d23cc61b93
27 changed files with 299 additions and 285 deletions

View File

@ -14,8 +14,8 @@
package basic // import "go.opentelemetry.io/otel/sdk/metric/processor/basic"
// Config contains the options for configuring a basic metric processor.
type Config struct {
// config contains the options for configuring a basic metric processor.
type config struct {
// Memory controls whether the processor remembers metric
// instruments and label sets that were previously reported.
// When Memory is true, CheckpointSet.ForEach() will visit
@ -24,7 +24,7 @@ type Config struct {
}
type Option interface {
ApplyProcessor(*Config)
applyProcessor(*config)
}
// WithMemory sets the memory behavior of a Processor. If this is
@ -37,6 +37,6 @@ func WithMemory(memory bool) Option {
type memoryOption bool
func (m memoryOption) ApplyProcessor(config *Config) {
config.Memory = bool(m)
func (m memoryOption) applyProcessor(cfg *config) {
cfg.Memory = bool(m)
}