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

Add support for DD_ENV, DD_SERVICE, and DD_VERSION environment variables #548

Merged

Conversation

jdgumz
Copy link
Contributor

@jdgumz jdgumz commented Mar 10, 2020

What does this PR do?

Adds support for DD_ENV, DD_SERVICE, and DD_VERSION to be used for setting {env, service, version} as global tags.

Description of the Change

The statsd client will now also read from the environment variables above to set global tag configuration. The tags are limited to the set of {env, service, version}.

Alternate Designs

If there is a better way to set global tag configuration from environment variables, I'll gladly make the change. I largely drew upon the existing pattern I saw.

Possible Drawbacks

None that I can think of - the changes are additive in nature.

Verification Process

Unit tests.

Additional Notes

None.

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@jdgumz jdgumz requested a review from a team as a code owner March 10, 2020 16:16
@jdgumz jdgumz added the changelog/Added Added features results into a minor version bump label Mar 10, 2020
@jdgumz jdgumz requested a review from hush-hush March 10, 2020 19:50
@hush-hush hush-hush self-assigned this Mar 10, 2020
@jdgumz jdgumz force-pushed the jesse.gumz/add-support-for-dd-env-service-version-tags branch from 3ba7ca8 to 14c724b Compare March 10, 2020 20:00
Copy link
Member

@hush-hush hush-hush left a comment

Choose a reason for hiding this comment

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

The PR looks good, just a small nit about the docstring

datadog/dogstatsd/base.py Outdated Show resolved Hide resolved
tests/unit/dogstatsd/test_statsd.py Show resolved Hide resolved
@jdgumz jdgumz changed the title Add support for DD_ENV, DD_SERVICE, DD_VERSION environment variables Add support for DD_ENV, DD_SERVICE, DD_VERSION, and DD_TAGS environment variables Mar 11, 2020
hush-hush
hush-hush previously approved these changes Mar 11, 2020
jirikuncar
jirikuncar previously approved these changes Mar 12, 2020
@jirikuncar
Copy link
Contributor

/azp run DataDog.datadogpy.integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jdgumz jdgumz changed the title Add support for DD_ENV, DD_SERVICE, DD_VERSION, and DD_TAGS environment variables Add support for DD_ENV, DD_SERVICE, and DD_VERSION environment variables Mar 12, 2020
@jdgumz jdgumz force-pushed the jesse.gumz/add-support-for-dd-env-service-version-tags branch from 419e9c9 to b7296e1 Compare March 12, 2020 17:30
@jdgumz jdgumz force-pushed the jesse.gumz/add-support-for-dd-env-service-version-tags branch from b7296e1 to 4054a10 Compare March 12, 2020 17:44
datadog/dogstatsd/base.py Show resolved Hide resolved
@jirikuncar jirikuncar dismissed hush-hush’s stale review March 12, 2020 18:21

We try to stay backward compatible.

@jirikuncar
Copy link
Contributor

/azp run DataDog.datadogpy.integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jdgumz
Copy link
Contributor Author

jdgumz commented Mar 12, 2020

/azp run DataDog.datadogpy.integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jirikuncar
Copy link
Contributor

/azp run DataDog.datadogpy.integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jirikuncar jirikuncar merged commit ad72cac into master Mar 17, 2020
@jirikuncar jirikuncar deleted the jesse.gumz/add-support-for-dd-env-service-version-tags branch March 17, 2020 19:32
therve added a commit that referenced this pull request Jan 21, 2021
Duplicate logic from #548 in threadstats.

Closes #618
therve added a commit that referenced this pull request Jan 21, 2021
Duplicate logic from #548 in threadstats.

Closes #618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/Added Added features results into a minor version bump resource/dogstatsd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants