-
Notifications
You must be signed in to change notification settings - Fork 11
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
Introduce 'default tags' to the dogstatsd payload #752
Conversation
This commit allows the user to specify a list of default tags to prefix on any generated tagset. These tags are assumed to be in valid form -- key:value,key:value -- without a trailing comma. Users may pass an empty string. REF SMPTNG-91 Signed-off-by: Brian L. Troutwine <[email protected]>
Signed-off-by: Brian L. Troutwine <[email protected]>
/// Selection of tag pairs to always prepend to tagsets. Assumed to be | ||
/// valid, do not count toward `tags_per_msg`. | ||
#[serde(default = "default_tags")] | ||
pub default_tags: Vec<String>, |
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.
Optional: this could be validated using serde's deserialize_with
attribute https://serde.rs/field-attrs.html#deserialize_with
if let Some(default_tag) = self | ||
.default_tags | ||
.choose(&mut *self.internal_rng.borrow_mut()) |
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.
I may be misunderstanding how this works; this looks like it'd pick one tag to prepend. Is that correct? That behavior doesn't match the config doc string.
I don't think prepending a static set of tags will meaningfully change the relationship between # contexts and # unique tags, which is the goal of SMPTNG-91. I don't have a super clear idea of how I want to do this, but something along these lines:
There is some uncertainty in there, but I think the two key distinctions I want to make is that the "common" tags are sampled from a pool (rather than being a static set) and that they consume from the "num_desired_tags" budget. |
I'd vote for a configurable value.
Gotcha. Okay, that would be a little more involved then. It's not a hard pull -- you have to make a pool as a part of the tag generator that's sampled from preferentially -- but this PR isn't that. |
fair enough, if you'd like to land this as-is I don't object, I just don't think it fully addresses the gap described in smptng-91. |
its still a WIP, but I've started to implement my ideas in #761 |
Closing in favor of #761. |
What does this PR do?
This commit allows the user to specify a list of default tags to prefix on any generated tagset. These tags are assumed to be in valid form -- key:value,key:value -- without a trailing comma. Users may pass an empty string.
Related issues
REF SMPTNG-91