Skip to content
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

Implement OTel config remapping #2691

Merged
merged 4 commits into from
Jun 7, 2024
Merged

Implement OTel config remapping #2691

merged 4 commits into from
Jun 7, 2024

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Jun 4, 2024

As per GDoc.

@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 81.43713% with 31 lines in your changes missing coverage. Please review.

Project coverage is 77.78%. Comparing base (48e857d) to head (89bcbe1).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2691      +/-   ##
============================================
- Coverage     79.33%   77.78%   -1.55%     
  Complexity     2223     2223              
============================================
  Files           200      227      +27     
  Lines         22371    26531    +4160     
  Branches          0      988     +988     
============================================
+ Hits          17747    20637    +2890     
- Misses         4624     5368     +744     
- Partials          0      526     +526     
Flag Coverage Δ
appsec-extension 69.13% <ø> (?)
tracer-extension 78.63% <81.43%> (+<0.01%) ⬆️
tracer-php 80.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
ext/configuration.h 100.00% <ø> (ø)
ext/ddtrace.h 62.50% <ø> (ø)
ext/sidecar.c 88.18% <100.00%> (ø)
ext/ddtrace.c 74.14% <50.00%> (-0.04%) ⬇️
ext/telemetry.c 93.33% <83.33%> (-0.52%) ⬇️
zend_abstract_interface/config/config.c 94.11% <84.61%> (-1.38%) ⬇️
zend_abstract_interface/config/config_ini.c 73.00% <89.47%> (+0.31%) ⬆️
ext/otel_config.c 79.50% <79.50%> (ø)

... and 26 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48e857d...89bcbe1. Read the comment docs.

OTEL_METRICS_EXPORTER=none
--INI--
OTEL_SERVICE_NAME=other service
OTEL_LOG_LEVEL=warn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a special case where OTEL_LOG_LEVEL=debug should set DD_TRACE_DEBUG=true. Is that change achievable with the current code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have it the other way round: DD_TRACE_DEBUG=true sets DD_TRACE_LOG_LEVEL=debug. So it does not make much sense to do that here, except that it would confuse telemetry to distinguish the provenance of the configs.

@pr-commenter
Copy link

pr-commenter bot commented Jun 4, 2024

Benchmarks

Benchmark execution time: 2024-06-07 15:02:45

Comparing candidate commit 89bcbe1 in PR branch bob/otel_cfg_remap with baseline commit 48e857d in branch master.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 175 metrics, 0 unstable metrics.

scenario:LaravelBench/benchLaravelBaseline-opcache

  • 🟥 execution_time [+61.607µs; +190.593µs] or [+2.394%; +7.406%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟥 execution_time [+4.852µs; +6.648µs] or [+3.387%; +4.640%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟥 execution_time [+14.970µs; +17.030µs] or [+5.002%; +5.691%]

@bwoebi bwoebi force-pushed the bob/otel_cfg_remap branch 3 times, most recently from 7287b9d to 969e9ae Compare June 6, 2024 12:15
@bwoebi bwoebi marked this pull request as ready for review June 6, 2024 12:15
@bwoebi bwoebi requested review from a team as code owners June 6, 2024 12:15
Copy link

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the API side


static void report_otel_cfg_telemetry_invalid(const char *otel_cfg, const char *dd_cfg) {
if (ddtrace_sidecar && get_DD_INSTRUMENTATION_TELEMETRY_ENABLED()) {
UNUSED(otel_cfg, dd_cfg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

tags.len = asprintf((char **)&tags.ptr, "config.opentelemetry:%s,config.datadog:%s", otel_cfg, dd_cfg);
ddog_sidecar_telemetry_add_span_metric_point_buffer(buffer, DDOG_CHARSLICE_C("tracers.otel.env.invalid"), 1, tags);
free((char *)tags.ptr);
ddog_sidecar_telemetry_buffer_flush(&ddtrace_sidecar, ddtrace_sidecar_instance_id, &DDTRACE_G(telemetry_queue_id), buffer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure DDTRACE_G(telemetry_queue_id); is initialized at that point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it isn't, good point.

@bwoebi bwoebi requested a review from a team as a code owner June 6, 2024 16:53
Copy link
Contributor

@iamluc iamluc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except 1 comment, 👍

ext/telemetry.c Outdated Show resolved Hide resolved
bwoebi added 3 commits June 7, 2024 15:53
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
…d is allocated

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/otel_cfg_remap branch from 4d63cda to 52d87bc Compare June 7, 2024 13:53
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/otel_cfg_remap branch from 52d87bc to 89bcbe1 Compare June 7, 2024 14:35
@bwoebi bwoebi merged commit f8c9e42 into master Jun 7, 2024
503 of 506 checks passed
@bwoebi bwoebi deleted the bob/otel_cfg_remap branch June 7, 2024 15:29
@github-actions github-actions bot added this to the 1.1.0 milestone Jun 7, 2024
morrisonlevi pushed a commit that referenced this pull request Jun 10, 2024
* Implement OTel config remapping

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>

* Use global buffer for telemetry to avoid sending before the request id is allocated

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>

* Fix c&P failure

* Update libdatadog

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>

---------

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants