-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Metricbeat] Prometheus based module should support metrics filtering #15493
Comments
ProposalStill need to investigate how it could be implemented on the collector's level. Most probably we will have to scape the whole response from the endpoint and filter out the metrics accordingly before sending the events. Collector config options
include_metrics:
- ibmmq_* This would only keep metrics that start with
ignore_metrics:
- process_*
- go_*
- istio_mcp_request_acks_total This would filter out all unnecessary metrics (see the source at istio sample metrics)
metrics:
- mixer_config_attributes_total: config_attributes
- mixer_handler_daemons_total: handler_daemons
... This would implement the mapping which defines which metrics should only be collected and how they should be mapped to fields. In order to cover cases where we only want to map some specific metrics but we want to keep all the rest as is a metrics:
- *
- mixer_config_attributes_total: config_attributes
- mixer_handler_daemons_total: handler_daemons Combining these optionsThe process of filtering out metrics would be first to apply the
family should be fetched or not, according to family.Name and the filter lists.
|
This could be useful for OpenMetrics( #14982) module too. |
Comments moved from #14982:
Yes, probably, I don't think exporters in general support filtering. Maybe we can do the filtering in
I would prefer an explicit option for something like this, or we could also not support using both filtering and mapping to avoid tricky cases. |
Have we considered using existing processors to filter out unwanted metrics? The clear benefit is that it provides the same method for all modules, instead of something Prometheus specific. That said, I see value in what you propose, as it should save some memory & cpu we use when processing unwanted metrics, just to drop them afterwards. Regarding the config options, I have mixed feelings about allow for custom mappings in Prometheus metrics. We have done them in the past for some modules, using the Prometheus helper, but as we move forward with lightweight modules/inputs it sounds to me that keeping the original names is better for users. Specially once we provide better ways to query them as they would expect. Perhaps we should leave mappings out of the scope of this issue and discuss the need in a different one? |
Thanks @exekias for commenting here! Answering inline:
Processors are already used in The fact that we gain in performance by skipping events is also a plus.
I agree!
I agree with that too! As it was mentioned in the implementation PR #16420 we can leave it out for now. To be honest having in mind |
Here comes another PR that would appreciate this feature: #16482 |
PR was merged. Closing this one. |
Lightweight modules based on Prometheus store all collected metrics. Unfortunately if there are metrics not related to the observed product (e.g. exporter's metrics), they will be collected as well, even if they're less important and just overloading the storage).
The goal of this task is to expose a module configuration feature that defines allowed metric name prefixes.
This feature could be used by the IBM MQ module: #15301
The text was updated successfully, but these errors were encountered: