-
Notifications
You must be signed in to change notification settings - Fork 651
feat: Support mixed categories for semconv opt-in #7274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Support mixed categories for semconv opt-in #7274
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7274 +/- ##
=====================================
Coverage 81.0% 81.1%
=====================================
Files 204 204
Lines 18095 18188 +93
=====================================
+ Hits 14672 14762 +90
- Misses 3003 3005 +2
- Partials 420 421 +1
🚀 New features to boost your workflow:
|
@@ -173,7 +173,7 @@ func (s HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { | |||
|
|||
func NewHTTPServer(meter metric.Meter) HTTPServer { | |||
env := strings.ToLower(os.Getenv(OTelSemConvStabilityOptIn)) | |||
duplicate := env == "http/dup" | |||
duplicate := strings.Contains(env, "http/dup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a nit, but using Contains
means writing down http/dupdatabase
works. So does http/dup;database
.
Should we ensure the string is properly separated by commas? (obviously, this has a performance impact, so I'm also fine saying it doesn't matter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I have this issue too. But since it only needs to be executed once, I think the overhead is worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple and very strange way: strings.Contains(","env+",", ",http/dup,")
Not for reference or advice.
Resolves #7246
Introducing support for category-specific values in the OTEL_SEMCONV_STABILITY_OPT_IN environment variable for otelhttp and otelmongo. For example, multiple categories should be supported without error: