Comments (7)
and are definitely not fully compatible with each other.
Can you expand in which way recent Prometheus versions are not compatible with the OpenMetrics specification?
Note that this has also been discussed in #66 (comment) and in #51. I don't understand why this requires a new GitHub issue.
from client_rust.
Can you expand in which way recent Prometheus versions are not compatible with the OpenMetrics specification?
Consider a counter metric exported via curl <hostport>/metrics
, and specifically maybe e.g. the mxinden/kademlia-exporter metric kademlia_exporter_meta_random_node_lookup_triggered
. Running that program and then fetching the /metrics endpoint returns
# HELP kademlia_exporter_meta_random_node_lookup_triggered Number of times a random Kademlia node lookup was triggered.
# TYPE kademlia_exporter_meta_random_node_lookup_triggered counter
kademlia_exporter_meta_random_node_lookup_triggered_total 1
Note that the HELP and TYPE lines have metric name "kademlia_exporter_xxx" and that the actual metric data line has a metric name "kadmelia_exporter_xxx_total". This may be valid for OpenMetrics, but it is not valid for Prometheus. Prometheus requires consistent metric names, e.g.
# HELP kademlia_exporter_meta_random_node_lookup_triggered_total Number of times a random Kademlia node lookup was triggered.
# TYPE kademlia_exporter_meta_random_node_lookup_triggered_total counter
kademlia_exporter_meta_random_node_lookup_triggered_total 1
from client_rust.
I don't understand why this requires a new GitHub issue.
Consider this issue a superset of the other issues. OpenMetrics and Prometheus define specs which are not equivalent. If this repo lives in the Prometheus org, it should implement the Prometheus spec. If it doesn't implement the Prometheus spec, then it shouldn't live in the Prometheus org. That's my only point.
from client_rust.
I was also trying to understand why the metrics exported by this crate can't be scraped by Prometheus.
In particular, the issue is with the Info
metric that is not part of the default set and leads to the error invalid metric type "info"
preventing all other metrics to be scraped too (tested with prometheus 2.51.2 and some other verions — none of them could deal with this format).
So I think it is confusing indeed that the official Prometheus client doesn't work with Prometheus. I can see the following possible solutions:
- rename this crate to something like
open-metrics-client
or - add a possibility to export metrics in Prometheus format as done in Python client
Upd: after setting the correct header with the response, Prometheus could parse the output, but it's still confusing that those formats are not compatible and the naming doesn't suggest which one is used.
from client_rust.
@08d2 and @kalabukdima I understand your concerns.
@RichiH do you have additional input here as one of the authors of the open metrics specification? How should the Rust client proceed to be consistent within the Prometheus ecosystem.
In the meantime, @08d2 and @kalabukdima, how about very prominently calling out on the main docs.rs page (i.e. in src/lib.rs
) that application/openmetrics-text
needs to be set as a content type? Does either of you want to create a pull request?
from client_rust.
FYI, OpenMetrics is now part of Prometheus officially
I am on the road right now, but this feels like a bug in Prometheus. Potentially dev summit material to discuss?
from client_rust.
FYI, OpenMetrics is now part of Prometheus officially
Can you point us to some docs @RichiH? Is OpenMetrics the default? Is setting the HTTP content type still needed?
Related: #194 and prometheus/prometheus#13944
from client_rust.
Related Issues (20)
- Allow flattening of a struct through derive(EncodeLabelSet) at any position HOT 2
- Make `Descriptor::new` `const` HOT 1
- feat: derive register logic on struct of metrics
- Allow multiple labels in sub_registry_with_label method HOT 2
- Allow root registry creation with prefix AND label(s) HOT 1
- Implement native histograms HOT 1
- Escaping? HOT 3
- Public encoding functions? HOT 4
- Encoder without EOF HOT 5
- Custom Collector with `sub_registry_with_prefix` outputs name multiple times HOT 3
- Abstract key lookup into a trait for Family::get_or_create HOT 4
- Allow iterating the metrics on an registry HOT 1
- Allow construct a histogram family with a closure HOT 2
- mips: EncodeCounterValue implementation missing for u32?
- Histogram with empty family labels creates unparseable metrics output HOT 1
- text::DescriptorEncoder writes incorrect metric names HOT 2
- UTF-8: Implement support in Rust client library
- Implement Atomic for usize HOT 2
- Counter `HELP` and `TYPE` lack `_total` suffix HOT 5
- Provide a way to prevent unbounded metric growth HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client_rust.