-
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] OpenMetrics Module #14982
Comments
Hey @sorantis ! It looks like it could be easily implemented as a light module on top of prometheus collector metricset (like default: true
input:
module: prometheus
metricset: collector
defaults:
metrics_path: /_metrics In this, I see value in introducing a new option here into the collector metricset so as to have the option to collect only specific metrics. Consider it an equivalent to |
Technically processors could be used like in https://github.com/elastic/beats/blob/master/x-pack/metricbeat/module/ibmmq/qmgr/manifest.yml. However in the case of OpenMetrics each case would be different so we need a mechanism to provide the user with, making it possible to define which metrics want or doesn't want to keep from the scrapping endpoint at the configuration level. So my thought is that |
Yes, if we want to avoid scrapping metrics then processors won't work, but I am not sure if exporters in general expose methods to filter metrics when scrapping. In prometheus we can use a match query to select the metrics to scrape, this works when querying a prometheus server:
But I guess this doesn't work with exporters in general.
I was thinking more in In general when we have had services that expose a lot of data we have opted by collecting all of it, and telling users to use processors to filter out. This has the advantage of having a common way of filtering out information, while still being able of collecting all the data for interested users. The alternative is to implement different ways of filtering on each module, what is less user friendly (but sometimes way more efficient). But it is true that prometheus is its own beast. It is completely generic, and sometimes parsing big responses is expensive, specially if we are later going to drop part of the results. So yes, it can be ok to implement some way of mapping. So even if we collect complete responses from exporters we can still decide which ones to parse, and avoid scripts like the one in the IBM MQ module.
@ChrsMark could you make a proposal on how it would look like in the config? |
👍
Sure! I will also check how the collector could leverage such an option in an efficient way. |
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.
|
@ChrsMark sounds good! I would like to know what @exekias and @sorantis think about this too.
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. |
We already had an issue for this, so I moved the proposal there -> #15493 |
@ChrsMark agreed. this could be a useful feature for users who want to fine tune their metric collection and pull only a subset of exposed metrics. FYI theres' a PR that takes this further and only enables collection of PromQL query results. |
@ChrsMark can we close this one? if not, what's missing? |
Updated the PR description with what is missing, however I'm not sure what would be the best option for adding |
@andresrc leftovers have been added, we can close this one. |
OpenMetrics is an effort to standardize exposing metric data based on the Prometheus exposition format.. It's still a draft, and is sandboxed by the CNCF, with the ultimate goal to create an RFC.
Create a dedicated module to monitor any OpenMetrics compliant endpoint using Metricbeat
This can be a light module based on Prometheus.
Checklist
For a metricset to go GA, the following criterias should be met:
* [ ] Supported versions are documented* [ ] Supported operating systems are documented (if applicable)* [ ] Integration tests exist* [ ] Dashboards exists (if applicable)data.json
exists and an automated way to generate it exists (go test -data
)The text was updated successfully, but these errors were encountered: