-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Improve prometheus metric mapping to internal metrics / line protocol #4415
Comments
Update proposal with a method for splitting/joining metric names. @trevorwhitney I believe if we use the transformations above in the prometheus input and output, it will allow us to add the histogram TYPE in the histogram aggregator and have the output be usable by Prometheus. |
What about points with a simple metric name (without underscores)?
|
This seems like it could be solved by the current approach in the prometheus output plugin: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/prometheus_client/prometheus_client.go#L552-L556 We'd lose roundtripping of metrics ending in |
Can't we just keep the prometheus timeseries as is and have prometheus tags/buckets as tags? Renaming them as they move thru telegraf would change the originality of the metric and would require users to understand this transformation to map to their original prom metric. # TYPE cpu_usage_user gauge Expected behavior: |
I think @vishiy's method is the better approach:
For users who want metric name splitting, it would be possible to handle this in a separate processor plugin. I have updated the original post to reflect this style. |
@danielnelson - Sent a PR out for this (prometheus input changes) |
@vishiy @danielnelson The problem with bucket upper bounds as tags is that functions as histogramQuantile that would be needed to calculate quantiles over bucket histograms take a (numeric) field as upper bound expression, not a set of tags. How would you work around that / is there a way to convert tag ('le') values to typed (numeric + Inf) values in a (synthetic) field ? Without functionality like that it's still impossible to use efficient Prometheus histogram queries for dashboards. |
Thanks for pointing this out @Menthalion. This isn't actually a new method for encoding histograms, it is already in use in some places of Telegraf such as the histogram aggregator. @nathanielc Is there something we can do to make these compatible with Flux functions? |
Hi everyone, I'm currently building the PromQL->Flux transpiler for InfluxDB and already touched on this topic in influxdata/influxdb#13893. For any PromQL-ish use case, we don't want to do any transformations that are special to the metric type (which is a very loose concept on the Prometheus side to begin with) or metric name. The mapping rules (in Flux / InfluxDBv2 terminology) just have to be dumb like this:
The reason is that metric types are also not tracked or special-cased in Prometheus's own storage, so everything is just stored as flat labels and sample values. E.g. the only place where an In my transpiler work I also introduced a single field |
Hi Julius. Don't worry, this proposal has no special handling based on prom type, and any ideas of splitting the name have also been dropped (one can always do this in a processor instead). I feel like our handling of The
|
@danielnelson Thanks! If I understand you correctly you are agreeing with the simple mapping I proposed, plus the variant where you store the metric name in such a way that it would appear as the value of the And the |
I don't actually know how the columns are named in flux, but the field name in the database would be the prometheus metric_name, for example:
Yes, I think they must be written as tags in order for this style of encoding to work and all tags are string typed. |
That sounds good then, thanks.
Ah ok, wasn't 100% sure of this in the line protocol, since tags translate into columns in Flux, but columns can also have non-string types (float, int, string, bool). Good! |
Closed in #5767 |
This updates the metric_version of the prometheus input to version 2, which brings the telegraf mapping more inline with how prometheus natively outputs metrics, especially histograms and summaries. See influxdata/telegraf#4415 for more information.
This updates the metric_version of the prometheus input to version 2, which brings the telegraf mapping more inline with how prometheus natively outputs metrics, especially histograms and summaries. See influxdata/telegraf#4415 for more information.
* feat(telefraf): change the prometheus->telegraf metrics mapping (#113) This updates the metric_version of the prometheus input to version 2, which brings the telegraf mapping more inline with how prometheus natively outputs metrics, especially histograms and summaries. See influxdata/telegraf#4415 for more information. * feat(dashboard): Update dashboards for Grafana 7.1 (#135) * feat(dashboard): Update dashboards for Grafana 7.1 * fix(docker): Set specific version of grafana for docker-compose * feat: Rename Telegraf to Sentinel Drone (#131) * feat: Add visor to Makefile; CI build (#149) * feat: add visor to makefile * Update Makefile Co-authored-by: Oli Evans <[email protected]> * chore: Remove sentinel- prefix in CLI usage * chore: Add rust deps to CI build env * chore: Add latest visor Co-authored-by: Oli Evans <[email protected]> Co-authored-by: Mike Greenberg <[email protected]> * dep: Update to [email protected] (#155) * feat(grafana): Update dashboards for latest Visor schema (#156) * chore: Fixup Makefile and docker-compose; Update submodules (#157) * chore: Remove redis docker-compose svcs; Create jaeger config * chore: Update docker-compose timescale svc to pg12 * chore: visor-indexer and -processor make directives use new subcommand * deps: Update to [email protected] and [email protected] * deps: Update to [email protected] * chore: Remove chainwatch services; Fix visor services * fix(docs): Correct documentation for visor and naming * Apply suggestions: Service desc edits; log output adj in service Co-authored-by: Adrian Lanzafame <[email protected]> * Update dashboards chain_power -> chain_powers Co-authored-by: Adrian Lanzafame <[email protected]> Co-authored-by: Adrian Lanzafame <[email protected]> Co-authored-by: Ian Davis <[email protected]> Co-authored-by: Oli Evans <[email protected]>
Updated April 5, 2019. Check the edited ^^ history for old revisions.
Proposal
Example Input:
Current behavior:
Desired behavior:
Use case:
This will make histograms from prometheus use the same format as the histogram aggregator and also help with roundtripping back to the prometheus output.
See #4354
The text was updated successfully, but these errors were encountered: