-
Notifications
You must be signed in to change notification settings - Fork 31
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
Default system tags #61
Default system tags #61
Conversation
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.
(just for the sake of clarity: I work with Simone)
Should this be behind a (default) feature flag?
I think this is a good addition, especially since the official datadog libs are already doing this
fn with_default_system_tags<T, F: FnOnce() -> T>(f: F) -> T { | ||
std::env::set_var("DD_ENV", "production"); | ||
std::env::set_var("DD_SERVICE", "service"); | ||
std::env::set_var("DD_VERSION", "0.0.1"); | ||
let t = f(); | ||
std::env::remove_var("DD_ENV"); | ||
std::env::remove_var("DD_SERVICE"); | ||
std::env::remove_var("DD_VERSION"); | ||
t | ||
} |
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.
This causes flakiness. I've had test_new_default_tags
randomly fail locally because of this.
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.
Can i propose to put in the readme something like a test
section suggesting to test using the --test-threads 1
?
Hello @mcasper,
I took inspiration, for this PR, to ruby dogstatsd library. The general idea of this PR is to automatically set the
env
,service
andversion
tags in every metric we send. This could be accomplished settingDD_ENV
,DD_SERVICE
andDD_VERSION
environment variables.The code i refer to in the ruby dogstatsd library is this one
Please let me know if there's something else i can do and if you agree with this change.
Thank you in advance