-
Notifications
You must be signed in to change notification settings - Fork 151
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
Enable sidecar by default on PHP 8.3 #2680
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2680 +/- ##
============================================
- Coverage 79.40% 77.96% -1.44%
Complexity 2212 2212
============================================
Files 201 227 +26
Lines 22488 26551 +4063
Branches 0 988 +988
============================================
+ Hits 17857 20701 +2844
- Misses 4631 5324 +693
- Partials 0 526 +526
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 26 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
17f3a13
to
b5e4ec2
Compare
4f72426
to
bc1fa68
Compare
BenchmarksBenchmark execution time: 2024-06-07 21:43:42 Comparing candidate commit fa07162 in PR branch Found 6 performance improvements and 0 performance regressions! Performance is the same for 172 metrics, 0 unstable metrics. scenario:ComposerTelemetryBench/benchTelemetryParsing
scenario:ComposerTelemetryBench/benchTelemetryParsing-opcache
scenario:ContextPropagationBench/benchInject64Bit
scenario:ContextPropagationBench/benchInject64Bit-opcache
scenario:EmptyFileBench/benchEmptyFileBaseline-opcache
scenario:MessagePackSerializationBench/benchMessagePackSerialization
|
96cde75
to
0344bb0
Compare
get_global_DD_TRACE_AGENT_STACK_BACKLOG()); | ||
} | ||
#endif | ||
|
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.
The code paths are just to complicated for my brain, but why is it safe to move this code to dd_activate_once
?
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.
Background sender thread is only actually needed once spans may actually be flushed. And that never happens before dd_activate_once.
ext/ddtrace.h
Outdated
@@ -64,6 +64,10 @@ void dd_internal_handle_fork(void); | |||
void dd_run_rust_thread_destructors(void *unused); | |||
#endif | |||
|
|||
#ifndef _WIN32 | |||
void disable_sidecar_sending(void); |
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.
nitpick: this function does not seem to be used elsewhere but in ddtrace.c
. So you could declare it before its usage (+ make it static
) and remove the declaration from here
--TEST-- | ||
Sidecar should be enabled by default on PHP 8.3 | ||
--SKIPIF-- | ||
<?php include 'startup_logging_skipif_unix_83.inc'; ?> |
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.
The name is a bit confusing. What about startup_logging_skip_unless_unix_83
?
Also, what about moving the files to the includes
directory
0344bb0
to
46ca434
Compare
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.
LGTM functionnaly speaking.
Thanks a lot for going through with finishing implementation and adding telemetry
90f1fef
to
c4d648a
Compare
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Manually set sidecar sender config. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
c4d648a
to
446a704
Compare
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
446a704
to
a0edcc0
Compare
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.
Cannot approve my own PR (even though, it's clearly not my PR anymore :p)
Overall LGTM, I just have a few questions. Also realizing that the sidecar sets _top_level
I would have rather not if not agentless.
@@ -42,19 +47,19 @@ public function testTracesFromLongRunningFunctionWithMixedTracing() | |||
$rootTraceAssertion = function ($i) { | |||
return SpanAssertion::exists("do_manual_instrumentation_within_root_trace_function", "run $i") | |||
->withChildren([ | |||
SpanAssertion::exists("first-sub-operation")->withChildren( |
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.
I don't get why those have changed
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.
normalization changes. Do you want to revert 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.
I'd rather not mess around unnecessarily by now.
@@ -540,6 +540,10 @@ function ($key) use ($pattern) { | |||
if (isset($spanMetrics["process_id"])) { | |||
unset($spanMetrics['process_id']); | |||
} | |||
if (isset($spanMetrics["_top_level"])) { | |||
// Set by sidecar only | |||
unset($spanMetrics['_top_level']); |
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.
The sidecar, if not agentless, shouldn't set, for the sake of consistency with the other tracers.
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.
Uh, I thought _top_level is an attribute of partial flushing anyway - e.g. java is setting it: https://github.com/DataDog/dd-trace-java/blob/fff0006e3844272fc7bc711117b15dfd87a8feee/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV0_5.java#L258
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.
Java is setting _dd.top_level
, this is one set only by the agent
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
fa07162
to
1085733
Compare
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.
As Pierre cannot self-approve :-)
This reverts commit c5f2dcb.
* Enable sidecar by default, only when telemetry is enabled * Manually set sidecar config to false Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * minor comments in the tests * add a test to make sure sidecar is enabled by default in 8.3 * Delay bgs initialization until sidecar sender status is finalized Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Fix crash Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Add telemetry for telemetry disabled Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Fix mem leak Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Hack to massage sidecar v0.7 into what is expected by tests Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Fix telemetry path Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * More test stability Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Fix header name * Update libdatadog * Test fixes Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * In the agent sampling test, telemetry conflicts with sidecar Manually set sidecar sender config. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Avoid parseMultipleRequestsFromDumpedData with sidecar * Skip valgrind test Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> * Turn sidecar sender off in valgrind tests because of false positives Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> --------- Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com> Co-authored-by: Bob Weinand <bob.weinand@datadoghq.com> Co-authored-by: Björn Antonsson <bjorn.antonsson@datadoghq.com> Co-authored-by: Luc Vieillescazes <luc.vieillescazes@datadoghq.com>
Description
This PR enables sending traces on Unix through the sidecar by default in PHP 8.3.
This will thus impact 5% of our customers.
If the customer has explicitly disabled telemetry (thus the sidecar), we need to fallback to the background zender.
This is tested through unit tests on config logging.
APMSP-1154
Reviewer checklist