config: add support for configuring propagators#6727
config: add support for configuring propagators#6727jpkrohling wants to merge 12 commits intoopen-telemetry:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6727 +/- ##
=====================================
Coverage 75.5% 75.6%
=====================================
Files 207 208 +1
Lines 19152 19177 +25
=====================================
+ Hits 14478 14500 +22
- Misses 4239 4241 +2
- Partials 435 436 +1
🚀 New features to boost your workflow:
|
|
Changelog entry is missing. |
codeboten
left a comment
There was a problem hiding this comment.
Thanks for taking on this work @jpkrohling! Added a couple of comments
3448a6c to
1440ce9
Compare
|
Note: I changed a couple of things in autoprop, to account for two edge cases: an empty input, which IMO should have the same behavior as if the value wasn't specified), and an empty value, which IMO should be skipped. |
|
If this looks good, I'll fix the merge conflicts. |
7d7a2fc to
3f4d138
Compare
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
d336f76 to
e40d6df
Compare
MrAlias
left a comment
There was a problem hiding this comment.
Looks good overall. Thanks for working on this.
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
| n := len(cfg.opentelemetryConfig.Propagator.Composite) | ||
| if n == 0 { | ||
| return autoprop.NewTextMapPropagator(), nil | ||
| } |
There was a problem hiding this comment.
There is a difference between
"propagator": {
}, and
"propagator": {
"composite": []
}, From the specification:
If a property has a default value defined (i.e. is not required) and is missing or present but null, Create MUST ensure the SDK component is configured with the default value.
The first one should return the default value. The second an empty composite propagator.
The code should be probably like this:
if cfg.opentelemetryConfig.Propagator.Composite == nil {
return propagation.NewCompositeTextMapPropagator()
}
n := len(cfg.opentelemetryConfig.Propagator.Composite)
if n == 0 {
return autoprop.NewTextMapPropagator(), nil
}| if *name == "" { | ||
| return nil, errInvalidPropagatorEmpty | ||
| } |
There was a problem hiding this comment.
I do not see anything in the schema that disallows using empty name. See: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema/propagator.json
autoprop supports empty names (similarly to database/sql).
Sorry that I was not precise in #6727 (comment) 🙇
There was a problem hiding this comment.
i opened an issue in the configuration repo to discuss this, i submitted a PR to propose enforcing a minimum length on propagator configuration
|
Blocked by #6796: #6796 (comment) |
|
Folks, sorry for dropping the ball on this one. I'm closing, as I don't think I have time to merge the conflicts and follow-up on potential changes from the next PRs. Feel free to use the PR as inspiration for new PRs! |
This is reviving open-telemetry#6727 to add support for configuration of propagators in otelconf. Fixes open-telemetry#6712 Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com>
Fixes #6712