open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.46k stars 1.47k forks source link

[ConfMap] - Providing custom merge method for koanf's Map.Merge #10370

Open jagan2221 opened 5 months ago

jagan2221 commented 5 months ago

Is your feature request related to a problem? Please describe. go.opentelemetry.io/collector/confmap exposes Merge method currently. I am writing a custom provider which uses confMap, I am trying to implement custom merge logic instead of default merging in underlying koanf map. Seems this is possible in koanf's library, by providing custom merge logic to koanf.Merge method, But confmap exposes normal merge currently and not custom merge functionality.

Ref-> https://github.com/knadh/koanf/blob/ef5fbbc9b413b38887e95d5600a330da5a842aa3/koanf.go#L405

Describe the solution you'd like Expose an additional Merge method in confMap which takes in custom merge function as argument and pass it to koanf's merge. confMap.Merge(in Conf, opts options)

VihasMakwana commented 2 months ago

@jagan2221 are you actively working on this?

VihasMakwana commented 2 months ago

@mx-psi @TylerHelmuth can you assign this to me? I'll take this enhancement up.

There are many issues related to this particular functionality and it would be great to have a custom merge strategy supported.