Allow disabling metrics with data-prepper-config.yaml#5627
Merged
dlvenable merged 2 commits intoopensearch-project:mainfrom May 1, 2025
Merged
Allow disabling metrics with data-prepper-config.yaml#5627dlvenable merged 2 commits intoopensearch-project:mainfrom
dlvenable merged 2 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Siqi Ding <dingdd@amazon.com>
dlvenable
requested changes
Apr 24, 2025
Member
dlvenable
left a comment
There was a problem hiding this comment.
Thank you @Davidding4718 for this contribution!
| import java.util.Collections; | ||
| import java.util.List; | ||
|
|
||
| public class DisableMetricsFilter implements MeterFilter { |
Member
There was a problem hiding this comment.
This class should have unit tests. This is the best place for testing different combinations of different values such as:
- "jvm.gc.max.data.size"
- "jvm.gc.**"
- "**.http.successRequests"
You can use JUnit's @ParameterizedTest to make some good test case coverage.
Contributor
Author
There was a problem hiding this comment.
I have created a DisableMetricsFilterTest class in test folder.
| @JsonProperty("metric_tag_filters") | ||
| final List<MetricTagFilter> metricTagFilters, | ||
| @JsonProperty("disabled_metrics") | ||
| @JsonAlias("disabledMetrics") |
Member
There was a problem hiding this comment.
We don't need this alias. This is a new feature, so we can just have the correct format of disabled_metrics.
Contributor
Author
There was a problem hiding this comment.
Got it! Have made the change.
Signed-off-by: Siqi Ding <109874435+Davidding4718@users.noreply.github.com>
alparish
pushed a commit
to alparish/data-prepper
that referenced
this pull request
May 22, 2025
…ject#5627) Add support for disabling metrics via data-prepper-config.yaml Signed-off-by: Siqi Ding <dingdd@amazon.com> Signed-off-by: Siqi Ding <109874435+Davidding4718@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the ability to disable specific metrics via the
data-prepper-config.yamlconfiguration file.To use this feature, add a new section to your configuration:
Known Limitations
Pattern matching is based on the raw Meter ID name, not what is displayed in CloudWatch (e.g., .sum, .count, .max).
jvm.gc.max.data.size.valuewon't work, because the base ID is onlyjvm.gc.max.data.size.Only:
works.
Only:
works.
Issues Resolved
Resolves #5431
Check List
- [ ] New functionality has javadoc added
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.