Move env and version from meta to span properties#2665
Conversation
eec3906 to
f12c033
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2665 +/- ##
============================================
+ Coverage 77.66% 77.72% +0.05%
- Complexity 2210 2212 +2
============================================
Files 225 225
Lines 26080 26109 +29
Branches 988 988
============================================
+ Hits 20256 20292 +36
+ Misses 5298 5291 -7
Partials 526 526
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2024-05-15 16:26:51 Comparing candidate commit abbbb6b in PR branch Found 10 performance improvements and 2 performance regressions! Performance is the same for 166 metrics, 0 unstable metrics. scenario:ContextPropagationBench/benchExtractTraceContext128Bit-opcache
scenario:HookBench/benchHookOverheadInstallHookOnFunction-opcache
scenario:HookBench/benchHookOverheadInstallHookOnMethod
scenario:HookBench/benchHookOverheadTraceFunction
scenario:HookBench/benchHookOverheadTraceMethod
scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching2
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:SpanBench/benchDatadogAPI-opcache
scenario:TraceAnnotationsBench/benchTraceAnnotationOverhead
scenario:TraceAnnotationsBench/benchTraceAnnotationOverhead-opcache
scenario:TraceSerializationBench/benchSerializeTrace
|
f12c033 to
d602b97
Compare
iamluc
left a comment
There was a problem hiding this comment.
There is a similar hack for the service.name tag, but handled in userland:
dd-trace-php/src/DDTrace/Span.php
Lines 152 to 154 in d602b97
would it be worthwhile to harmonize?
|
@iamluc the SERVICE_NAME is less of a hack, and more of an OpenTracing thing. I.e. it comes from an API which never directly assigns to meta. So the equivalence isn't really applicable here. |
d602b97 to
c90726b
Compare
As a fallback, direct assignments to $span->meta["env"] (or version) do still take precedence over the new properties. This was deprecated, and will be eventually removed. Side note: There were tests for DD_TAGS vs DD_ENV and DD_VERSION. These tests started failing. I elected to remove the tests instead of adding special handling in ddtrace_set_global_span_properties() (if key equals env and property_env non-empty, then ignore). These tests came from a 4 year old migration, at which time these tags had to be set via DD_TAGS, thus prioritizing DD_ENV and DD_VERSION explicitly made sense. By now it would just be a waste of CPU cycles to check that. Signed-off-by: Bob Weinand <[email protected]>
c90726b to
abbbb6b
Compare
As a fallback, direct assignments to $span->meta["env"] (or version) do still take precedence over the new properties. This was deprecated, and will be eventually removed.
Side note: There were tests for DD_TAGS vs DD_ENV and DD_VERSION. These tests started failing. I elected to remove the tests instead of adding special handling in ddtrace_set_global_span_properties() (if key equals env and property_env non-empty, then ignore). These tests came from a 4 year old migration, at which time these tags had to be set via DD_TAGS, thus prioritizing DD_ENV and DD_VERSION explicitly made sense. By now it would just be a waste of CPU cycles to check that.
This change is important for being able to track changes to service/env/version in the future context of remote configuration.