Redact OTLP header and Datadog key configs in telemetry - #11583
Open
bm1549 wants to merge 12 commits into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
bm1549
force-pushed
the
brian.marks/omit-sensitive-config-telemetry
branch
from
June 6, 2026 01:32
6f11563 to
19f31ad
Compare
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
bm1549
force-pushed
the
brian.marks/omit-sensitive-config-telemetry
branch
2 times, most recently
from
June 9, 2026 22:21
9639e05 to
2c36e1a
Compare
bm1549
commented
Jun 12, 2026
bm1549
commented
Jun 12, 2026
Contributor
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
PerfectSlayer
left a comment
Collaborator
There was a problem hiding this comment.
Left comment about sensitive config sync mechanism
…telemetry Add the OTLP exporter header configurations and the Datadog API key and application key configurations to the telemetry configuration filter list so their values are reported as "<hidden>" in the configuration telemetry: - OTEL_EXPORTER_OTLP_HEADERS - OTEL_EXPORTER_OTLP_TRACES_HEADERS - OTEL_EXPORTER_OTLP_METRICS_HEADERS - OTEL_EXPORTER_OTLP_LOGS_HEADERS - DD_API_KEY - DD_APPLICATION_KEY (and its DD_APP_KEY alias) For each configuration, every form that can reach ConfigSetting is covered: the dotted configuration names (otlp.traces.headers, otlp.metrics.headers, otlp.logs.headers, application-key, app-key) and the environment-variable names. Mark these configurations, DD_API_KEY, and DD_APPLICATION_KEY with "sensitive: true" in metadata/supported-configurations.json. Migrate ConfigSettingTest to JUnit 5 and extend it to cover the OTLP header and application key configurations, including an assertion that the configured value is not present in the reported telemetry value. Update ConfigCollectorTest so the application key collected through the ConfigCollector pipeline is asserted to render as "<hidden>". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…acted Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…to JUnit, redact api-key/profiling collect-path forms, tighten drift guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…onfigs Collect the profiling api key under its property name (single DD_ telemetry name), reduce CONFIG_FILTER_LIST to the property-name forms values are actually collected under, and map OTEL headers to their OTLP collected form in the drift guard. Also mark and redact the remaining collected credential configs: the profiling and crash-tracking proxy passwords and the RUM client token. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… in Groovy Remove redaction of the deprecated profiling.api-key/profiling.apikey fallback env vars (and the getEnvCollectedAs helper they needed). Only redact non-null values, so an unset sensitive config still reports null rather than <hidden>. Revert ConfigCollectorTest from JUnit back to its original Groovy form with minimal redaction edits, and trim the ConfigSettingTest table to a few representative cases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hand-maintained CONFIG_FILTER_LIST and its drift-guard test with a SENSITIVE_KEYS set generated from the "sensitive": true entries in metadata/supported-configurations.json, making the registry the single source of truth. ConfigSetting canonicalizes a collected key to env-var form (without double-prefixing an already-DD_-form key) and matches it against the generated set, so redaction fires whether the value arrived as a property name, dd.* system property, alias, or raw env var. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The merge with master switched the generated file to explicit imports, but the initSensitiveKeys() emission still used Set/HashSet/Collections.unmodifiableSet without emitting their imports, breaking compilation of the generated GeneratedSupportedConfigurations. Emit the java.util.Set/HashSet imports and use the unmodifiableSet static import to match the rest of the generated file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the env-var canonicalization out of ConfigSetting's private redactionKey into a reusable ConfigStrings.toCanonicalEnvVar, so the "config key in any form -> canonical DD_ env-var name" logic lives alongside the other key conversions and is unit-tested directly. Behavior is unchanged; normalizedKey() is untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ConfigSetting.normalizedKey() always prepended DD_, so a key already collected in env-var form (e.g. DD_PROFILING_API_KEY / DD_AAS_JAVA_EXTENSION_VERSION read via getEnv) was reported in config telemetry as the malformed DD_DD_PROFILING_API_KEY. Delegate to ConfigStrings.toCanonicalEnvVar, which adds the DD_ namespace only when not already present, fixing the name and collapsing the two near-identical canonicalization helpers into one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The code and the ConfigStrings.toCanonicalEnvVar javadoc already explain the behavior; remove the restating comments in ConfigSetting, the generator, and the tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add comment to clarify sensitive config handling
bm1549
force-pushed
the
brian.marks/omit-sensitive-config-telemetry
branch
from
August 5, 2026 15:55
4e3562e to
75f3948
Compare
bm1549
enabled auto-merge
August 5, 2026 17:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Renders sensitive configuration values as
<hidden>in configuration telemetry. This covers the OTLP exporter headers, Datadog API and application keys, profiling and crash-tracking proxy passwords, the RUM client token, and the test-agent session token. Redaction applies only to values that are set.The supported-config generator builds
GeneratedSupportedConfigurations.SENSITIVE_KEYSfrom thesensitive: trueentries inmetadata/supported-configurations.json.ConfigSettingcanonicalizes each collected key to env-var form before lookup, so redaction works for property names,dd.*system properties, aliases, and raw env vars.Motivation
Credentials and exporter headers should not be sent in configuration telemetry.
Additional Notes
DD_TEST_AGENT_SESSION_TOKENby marking it sensitive in the registry.ConfigSetting.normalizedKey()also corrects malformedDD_DD_*telemetry keys when a setting is collected in env-var form../gradlew spotlessApply./gradlew :utils:config-utils:test --tests datadog.trace.api.ConfigSettingTest --tests datadog.trace.util.ConfigStringsTest./gradlew :internal-api:test --tests datadog.trace.api.ConfigCollectorTest./gradlew :buildSrc:test -PrunBuildSrcTests --tests datadog.gradle.plugin.config.ParseV2SupportedConfigurationsTestContributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: N/A