Repository navigation
Conversation
The OpenMetrics 2.0 specification requires the fields of a histogram composite value to appear in a fixed order: count, sum, schema, zero_threshold, zero_count, negative_spans, negative_buckets, positive_spans, positive_buckets and finally bucket. Some test inputs listed the negative spans after the positive ones, or the classic buckets before the native fields. The parser does not currently enforce the order, so the tests passed regardless. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
…e-field-order test(textparse): follow OM 2.0 composite field order in test inputs
Runs Prometheus from main with --enable-feature=openmetrics2 on a single GCE VM, scraping a Go (client_golang main) and a Java (client_java main) example twice each, with OpenMetrics 1.0 and with OpenMetrics 2.0, so the stored series can be compared. The landing page links views that diff the series of the OM1 and OM2 jobs and compare their values and exemplars. The example /metrics endpoints are public, with /<app>/om1/metrics and /<app>/om2/metrics setting the Accept header. Based on the histogram compat demo deploy scripts. Not meant to be merged. Signed-off-by: Bartek Plotka <bwplotka@google.com>
…Go app Signed-off-by: Bartek Plotka <bwplotka@google.com>
| # docker build --build-arg CLIENT_JAVA_REF=<sha> --output type=local,dest=<dir> . | ||
| # | ||
| # which writes <dir>/app.jar (a fat jar) and <dir>/client_java.version. | ||
| FROM eclipse-temurin:25-jdk AS build |
…g page Signed-off-by: Bartek Plotka <bwplotka@google.com>
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.
Live: https://35-204-166-191.sslip.io/
Runs Prometheus from main with
--enable-feature=openmetrics2,exemplar-storageon a single small GCE VM. It scrapes a Go example (client_golang main) and a Java example (client_java main) twice each: once withscrape_protocols: [OpenMetricsText1.0.0]and once with[OpenMetricsText2.0.0]. The landing page links views that diff the series stored by the OM1 and OM2 jobs, and compare their values and exemplars.The /metrics endpoints of both examples are public.
/<go|java>/om1/metricsand/<go|java>/om2/metricsset the Accept header and serve the result astext/plainso browsers show it./<go|java>/metricspasses the client's Accept header through.Files in
cmd/prometheus/demo_om2_gce/:prometheus.yml: the 4 scrape jobs (go-om1,go-om2,java-om1,java-om2).goapp/: the client_golang example. It's a separate module;deploy.shbumps client_golang toGO_CLIENT_REF(main) at build time.javaapp/: the client_java example and a Dockerfile that builds client_java fromJAVA_CLIENT_REF(main) plus the example's fat jar, so neither the Cloudtop nor the VM needs a JDK.landing.py: the landing page and the demo query links.deploy.shandstartup.sh: based on the histogram compat demo ([DEMO] Histogram Query Conversions #4). Caddy serves TLS for<ip>.sslip.io, and the VM pulls releases from a private bucket. Prometheus runs asprom-demo@demo, and the examples run asprom-demo-app@{go,java}.What the views show on current mains:
http.server.active_requestsis stored ashttp_server_active_requests), because Prometheus doesn't sendescaping=allow-utf-8for OM2. The fix is in scrape: request escaping scheme for OpenMetrics 2.0 scrapes prometheus/prometheus#19902._totalor unit suffixes, sohttp_requests(OM2) andhttp_requests_total(OM1) are different series._bucketseries, OM2 ones on_count.Usage:
Not meant to be merged.