-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Component(s)
No response
Describe the issue you're reporting
The configoptional.Optional struct does not allow programmatic setting of values. This is what we have to use instead:
rf := otlpreceiver.NewFactory()
cfg := rf.CreateDefaultConfig().(*otlpreceiver.Config)
_ = cfg.GRPC.Unmarshal(confmap.NewFromStringMap(map[string]any{"endpoint": fmt.Sprintf("%s:%d", listeningAddress, grpcPort)}))
_ = cfg.HTTP.Unmarshal(confmap.NewFromStringMap(map[string]any{"endpoint": fmt.Sprintf("%s:%d", listeningAddress, httpPort)}))
The same problem applies if say we try to explicitly the value to nil.
I seek that we add to the configoptional.Optional struct methods that allow to set values, including the case where the value is explicitly nil.
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Metadata
Metadata
Assignees
Labels
No labels