[Feature] Add metric category filtering support to Prometheus exporter#4084
Open
j1wonpark wants to merge 2 commits intoapache:masterfrom
Open
[Feature] Add metric category filtering support to Prometheus exporter#4084j1wonpark wants to merge 2 commits intoapache:masterfrom
j1wonpark wants to merge 2 commits intoapache:masterfrom
Conversation
Allow users to enable/disable metric categories (self-optimizing, optimizer-group, orphan-files, ams-jvm, table-summary) via metric-reporters.yaml properties. All categories are enabled by default for backward compatibility. Also update Helm chart values and configmap tests to reflect the new configuration options. Signed-off-by: jiwonpark <jiwonpark@example.com> Signed-off-by: Jiwon Park <jpark92@outlook.kr>
Contributor
|
@j1wonpark Thanks a lot for the proposal. I think it is useful to support filtering some metrics. |
Contributor
Author
|
@zhoujinsong Thanks for the feedback! Regex support sounds like a great idea. |
Replace the fixed category enum approach with a flexible regex-based metric filter. Users can now specify include/exclude patterns via metric-filter.includes and metric-filter.excludes properties to freely configure which metrics are exported. Signed-off-by: Jiwon Park <jpark92@outlook.kr>
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.
Why are the changes needed?
Currently, the Prometheus exporter exposes all registered metrics (~61 metrics) unconditionally. As the number of tables grows, the volume of metrics increases significantly. Users need the ability to selectively enable/disable metric categories to reduce noise and focus on the metrics that matter to their use case.
Brief change log
MetricCategoryenum inamoro-metrics-prometheusmodule to define 5 metric categories (self-optimizing,optimizer-group,orphan-files,ams-jvm,table-summary) with their corresponding metric name prefixesMetricsCollectorto accept a set of disabled categories and filter them out inisValidMetric()PrometheusMetricsReporterto parse category settings frompropertiesinopen()and pass them toMetricsCollectormetric-reporters.yamlwith category filtering configuration examplesvalues.yamlandamoro-configmap_test.yamlto reflect the new configuration optionsConfiguration example:
All categories are enabled by default for backward compatibility.
How was this patch tested?
MetricCategoryTest(10 tests): category matching, properties parsing, case-insensitive values, invalid valuesMetricsCollectorFilterTest(5 tests): no filter, single/multiple disabled categories, unknown metrics not filtered, orphan-files multi-prefix filtering./mvnw test -pl amoro-metrics/amoro-metrics-prometheus -am— 15 tests passedhelm unittest charts/amoro— 74 tests passedDocumentation