Skip to content

Conversation

@iamluc
Copy link
Contributor

@iamluc iamluc commented Jun 17, 2025

Description

Implement https://docs.google.com/document/d/1wydXj2fW0V0jaWU6W9pIbipT_AXD15tmbTtOPXFBEy4/edit?tab=t.nun42691l9k2 for PHP

https://datadoghq.atlassian.net/browse/INPLAT-577

System-tests PR: DataDog/system-tests#4797

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@pr-commenter
Copy link

pr-commenter bot commented Jun 17, 2025

Benchmarks [ tracer ]

Benchmark execution time: 2025-07-21 16:24:12

Comparing candidate commit c525ae0 in PR branch luc/ssi-config-telemetry with baseline commit 779da23 in branch master.

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

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟩 execution_time [-5.819µs; -5.458µs] or [-8.686%; -8.148%]

}
char **ddtrace_ssi_forced_injection_enabled = (char **)DL_FETCH_SYMBOL(module->handle, "ddtrace_ssi_forced_injection_enabled");
if (ddtrace_ssi_forced_injection_enabled) {
*ddtrace_ssi_forced_injection_enabled = getenv("DD_INJECTION_FORCE");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
*ddtrace_ssi_forced_injection_enabled = getenv("DD_INJECTION_FORCE");
*ddtrace_ssi_forced_injection_enabled = force_load ? "True" : "False";

At least according to the document it should be only one of those values, not the raw value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, at least it would not report it correctly when force_load is set via ini.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated as you suggested

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup it should ideally be a Boolean but this behavior is not consistent across libraries. The .NET tracer reports raw configuration values to the instrumentation telemetry platform. Python reports the processed values. Other libraries do a mix of the two. This issue should be resolved by the config chaining initiative. Here we should go with the simplest implementation.

The ruby implementation is incomplete. I'll update it later today.

}
char **ddtrace_ssi_injection_enabled = (char **)DL_FETCH_SYMBOL(module->handle, "ddtrace_ssi_injection_enabled");
if (ddtrace_ssi_injection_enabled) {
*ddtrace_ssi_injection_enabled = getenv("DD_INJECTION_ENABLED");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Stupid question, not related to this PR, but we don't make use of that variable at all currently, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're correct. We don't need it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then this configuration feels misleading, I think we only should report what we actually use. We don't use that config, so we should not report it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @mabdinur WDYT? Again, it is similar to what's done in Ruby I think

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same approach we also used in Java and .NET. It was used to simplify the implementation and testing. These fields could also be used in debug logs or by other products (I believe it's used by the profiler in Python).

I dont have a strong opinion here. As long as we capture the right telemetry names and values this change looks good to me.

@iamluc iamluc marked this pull request as ready for review June 18, 2025 14:51
@iamluc iamluc requested a review from a team as a code owner June 18, 2025 14:51
@iamluc iamluc force-pushed the luc/ssi-config-telemetry branch from 9c29c6c to 33719c5 Compare June 20, 2025 14:44
@iamluc iamluc force-pushed the luc/ssi-config-telemetry branch from 33719c5 to 75d6075 Compare June 20, 2025 14:45
@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.80%. Comparing base (779da23) to head (c525ae0).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3301      +/-   ##
==========================================
- Coverage   61.92%   61.80%   -0.12%     
==========================================
  Files         140      140              
  Lines       12356    12356              
  Branches     1616     1616              
==========================================
- Hits         7651     7637      -14     
- Misses       3995     4008      +13     
- Partials      710      711       +1     

see 2 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 779da23...c525ae0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mabdinur mabdinur requested a review from bwoebi July 21, 2025 15:53
@mabdinur mabdinur enabled auto-merge July 21, 2025 15:53
Copy link
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

All comments addressed, nice :-)

@mabdinur mabdinur merged commit 8a256df into master Jul 21, 2025
1814 of 1881 checks passed
@mabdinur mabdinur deleted the luc/ssi-config-telemetry branch July 21, 2025 16:38
@github-actions github-actions bot added this to the 1.11.0 milestone Jul 21, 2025
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.

5 participants