-
Notifications
You must be signed in to change notification settings - Fork 306
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
Add support for DD_TAGS environment variable #703
base: master
Are you sure you want to change the base?
Conversation
Falls back to reading global tags from the DD_TAGS env var if DATADOG_TAGS is not present. DD_TAGS used for other datadog products, such as APM.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Can you update these docstrings accordingly ? datadogpy/datadog/threadstats/base.py Line 55 in 33f727c
datadogpy/datadog/dogstatsd/base.py Line 118 in 6bf4578
Thanks! |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Hi @nrmitchi, Thanks for opening this PR. Adding support for The main issue being that when We're also looking into aligning the behavior between all clients around this, which is a bit all over the place right now. In the meantime, clients that want to fetch tags from the env can easily do so using the library constructor. It's not the best but it's an easy workaround. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
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.
(clearing agent-core review request)
Falls back to reading global tags from the DD_TAGS env var if
DATADOG_TAGS is not present.
DD_TAGS used for other datadog products, such as APM.
What does this PR do?
Adds support for using constant tags from the
DD_TAGS
environment variable, rather than theDATADOG_TAGS
environment variable.This PR closes #702
Description of the Change
If the
DATADOG_TAGS
environment variable is not present, fall back to theDD_TAGS
environment variable for constant tags. This allows this library to match the behaviour of other datadog services (as well as the documentation).By using
DD_TAGS
only ifDATADOG_TAGS
is not present, this change should be backwards compatible with existing usage.Alternate Designs
An alternative was a straight replacement of the environment variable, however a fallback was chosen to maintain backwards compatibility and avoid dropping of existing tags.
Possible Drawbacks
It is possible that if a user is currently not using the
DATADOG_TAGS
environment variable for constant tags, but is using theDD_TAGS
environment variable for a different datadog service (such as APM), those tags will be added to custom metrics. This could lead to an unexpected increase in metric cardinality.Additional Notes
Currently duplicating all constant tags into both
DD_TAGS
andDATADOG_TAGS
environment variables is prone to error.Release Notes
If you are currently utilizing
DD_TAGS
environment variable for other datadog functionality, and not utilizingDATADOG_TAGS
for this library, your existingDD_TAGS
will be added to existing metrics.Review checklist (to be filled by reviewers)
changelog/
label attached. If applicable it should have thebackward-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.