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

feat: exclude matching metrics #1914

Merged
merged 9 commits into from
Aug 29, 2024
Merged

Conversation

DavSanchez
Copy link
Contributor

No description provided.

@DavSanchez DavSanchez requested a review from a team as a code owner August 26, 2024 22:12
@DavSanchez DavSanchez force-pushed the feat/exclude-matching-metrics branch from 17a684c to f66283b Compare August 28, 2024 09:35
Copy link
Contributor

@alvarocabanas alvarocabanas left a comment

Choose a reason for hiding this comment

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

LGTM, just left a question.

ctx := NewContext(cfg, buildVersion, hostnameResolver, idLookupTable, sampleMatchFn)
sampleMatchFn := sampler.NewSampleMatchFn(cfg.EnableProcessMetrics, config.MetricsMap(cfg.IncludeMetricsMatchers), ffRetriever)
sampleExcludeFn := sampler.NewSampleMatchFn(cfg.EnableProcessMetrics, config.MetricsMap(cfg.ExcludeMetricsMatchers), ffRetriever)
ctx := NewContext(cfg, buildVersion, hostnameResolver, idLookupTable, sampler.IncludeSampleMatchFn(sampleMatchFn), sampler.ExcludeSampleMatchFn(sampleExcludeFn))

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this casting needed? I see it wasn't before, did you add it for verbosity?

Copy link
Contributor Author

@DavSanchez DavSanchez Aug 28, 2024

Choose a reason for hiding this comment

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

I modified NewSampleMatchFn to accept a generic MetricsMap, so for both include and exclude I do the explicit conversion. Otherwise I had to convert only ExcludeMetricsMap into an IncludeMetricsMap to be able to pass it to NewSampleMatchFn, which didn't feel right and could be confusing for the future us.

@DavSanchez DavSanchez merged commit 08ce4b4 into master Aug 29, 2024
27 checks passed
@DavSanchez DavSanchez deleted the feat/exclude-matching-metrics branch August 29, 2024 07:58
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.

2 participants