Skip to content

Conversation

@StephenWakely
Copy link

@StephenWakely StephenWakely commented Jan 29, 2026

What does this PR do?

This allows lading to be configured so the dogstatsd generator will output metric names, tag names and values chosen from a preconfigured list.

Configuration is picked up from the file as:

        dogstatsd:
          metric_names:
            - thing
            - thung
          tag_names:
            - thing.thong
            - ning.nung
          tag_values:
            - thingthing
            - thangthang

Motivation

I'm setting up some benchmarks to observe the performance of tag aggregation - a new feature in the agent where you can configure given tags to be removed from metrics with given names. Given the performance will only be impacted when it processes a metric and tag combination that it has been configured to filter, we need to be able to ensure that lading can generate known metrics and tags.

Related issues

The PR I would like to exercise: DataDog/datadog-agent#44166

Additional Notes

The Payload Fingerprint verification job is failing. I'm not 100% sure what that is about, do I just need to update the fingerprint?

@StephenWakely StephenWakely changed the title Allow configuring metric names, tag names and values [AMCC-168]Allow configuring metric names, tag names and values Jan 29, 2026
pub(crate) use string_list_pool::StringListPool;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub(crate) enum Handle {
Copy link
Author

Choose a reason for hiding this comment

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

This is slightly questionable. With multiple string pools flying around now, there is a possibility that you could get a handle from one string pool and then try to fetch the string from another.

I've made it so it panics if you fetch a handle from a RandomStringPool and then try to use it on a StringListPool, but that still won't catch if you are just playing with different StringListPoolss.

I'm all ears if there is a better way around this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've been thinking for a while this part of the program needs to be rationalized. I think this is a good risk hedge and is indicative of the need to rethink all this -- outside of this line of work.


#[enum_dispatch(Pool)]
#[derive(Debug)]
pub(crate) enum PoolKind {
Copy link
Author

Choose a reason for hiding this comment

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

I've added enum_dispatch to handle the different types of pools we can have. Hope that is Ok. I tried to make everything generic over the different possible set of pools, but that resulted in a huge explosion of generics pretty much everywhere, which was not pleasant. Can try using dyn traits instead if you think that would be better.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I find this a pragmatic choice for this PR.

@StephenWakely StephenWakely marked this pull request as ready for review January 29, 2026 18:45
@StephenWakely StephenWakely requested a review from a team as a code owner January 29, 2026 18:45
pub(crate) use string_list_pool::StringListPool;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub(crate) enum Handle {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've been thinking for a while this part of the program needs to be rationalized. I think this is a good risk hedge and is indicative of the need to rethink all this -- outside of this line of work.


#[enum_dispatch(Pool)]
#[derive(Debug)]
pub(crate) enum PoolKind {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find this a pragmatic choice for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants