feat(internal/env): add env var config validation#3746
Merged
Conversation
BenchmarksBenchmark execution time: 2025-09-08 09:15:53 Comparing candidate commit d3d98c0 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 23 metrics, 0 unstable metrics. scenario:BenchmarkMetrics/gauge/get-handle-24
|
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
7 times, most recently
from
July 16, 2025 13:38
f6cd4c5 to
f7a5a8b
Compare
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
4 times, most recently
from
July 17, 2025 15:54
a139e40 to
587d59b
Compare
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
3 times, most recently
from
August 1, 2025 12:37
2c3b7c4 to
bc54e6a
Compare
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
6 times, most recently
from
August 4, 2025 11:54
e2551ba to
18adcab
Compare
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
3 times, most recently
from
August 8, 2025 17:28
3299683 to
abf0c6e
Compare
genesor
marked this pull request as ready for review
August 11, 2025 13:54
…ed to the json file
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
from
September 5, 2025 14:08
7743838 to
3a4ffcf
Compare
tonyredondo
approved these changes
Sep 5, 2025
genesor
force-pushed
the
ben.db/APMAPI-1450-wrap-os-env-calls
branch
from
September 8, 2025 08:25
3a4ffcf to
d5e5a71
Compare
rarguelloF
approved these changes
Sep 8, 2025
Member
Author
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
kakkoyun
pushed a commit
to kakkoyun/dd-trace-go
that referenced
this pull request
Sep 9, 2025
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 PR do?
This PR adds a new package
internal/envthat wrapsos.Getenvandos.LookupEnvcalls, allowing only known environment variables to be used.All environment variables/configuration keys are now listed in
internal/env/supported_configurations.jsonand then generated as a Go map ininternal/env/supported_configurations.gen.goafter running the generate command.This PR includes new CI steps/jobs:
os.Getenvandos.LookupEnvherego test(or equivalent) steps to check for the introduction of new configuration keys hereMost interesting parts to review:
internal/envpackageoscallstesting.Testing()being true only ingo testscenarios) that adds environment variables to the JSON fileinstrumentation/envpackageconfiginverterscriptCONTRIBUTING.mddocumentation for environment variablesDD-API-KEYhandled via alias system part of config inversion.Most of the changes involve migrating
oscalls and adding new tests to cover missing environment variables.Motivation
This PR main goal is to control the use of environment variables in the tracer so that we have a way to list and document every available configuration.
There is a new configuration registry implemented on the feature parity dashboard that contains all the configuration keys for every tracer.
Reviewer's Checklist
golangci-lint runlocally.Unsure? Have a question? Request a review!