-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Filter metrics by label keys and values #7822
Conversation
Codecov Report
|
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.
Will be a nice improvement!
datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py
Outdated
Show resolved
Hide resolved
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.
LGTM with a small comment about log with warning.
sample_labels = sample[self.SAMPLE_LABELS] | ||
for label_key, label_values in ignore_metrics_by_label.items(): | ||
if not label_values: | ||
self.log.warning( |
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.
curious if this might be a bit noisy? maybe debug is better?
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.
that sounds good, updated
c313716
ce92c22
to
6de3a96
Compare
* Add config option * ignore samples with matching label exclusion * filter all samples * Fix label key check * Fix style * Use plural in option name * Allow for wildcards * Add test for wildcard * Test invalid option value * Update log for invalid label values to warning * Use wildcard in list * Test exact match * Style * Drop warning to debug * Fix test e9343e4
What does this PR do?
This PR introduces a config option that allows users to ignore metrics with certain labels or label values.
in conf.yaml
The above will ignore metrics with labels
pid:puma_master
or any metric with labelworker:<ANY>
Motivation
FR
Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached