René's URL Explorer Experiment


Title: Summary quantiles collapse to the minimum observation when 2·epsilon ≥ 1−quantile · Issue #2292 · prometheus/client_java · GitHub

Open Graph Title: Summary quantiles collapse to the minimum observation when 2·epsilon ≥ 1−quantile · Issue #2292 · prometheus/client_java

X Title: Summary quantiles collapse to the minimum observation when 2·epsilon ≥ 1−quantile · Issue #2292 · prometheus/client_java

Description: Version io.prometheus:prometheus-metrics-core:1.8.0 (the affected code in CKMSQuantiles is unchanged since at least 1.3.x and is still present on main). Reproducer import io.prometheus.metrics.core.metrics.Summary; import io.prometheus.m...

Open Graph Description: Version io.prometheus:prometheus-metrics-core:1.8.0 (the affected code in CKMSQuantiles is unchanged since at least 1.3.x and is still present on main). Reproducer import io.prometheus.metrics.core...

X Description: Version io.prometheus:prometheus-metrics-core:1.8.0 (the affected code in CKMSQuantiles is unchanged since at least 1.3.x and is still present on main). Reproducer import io.prometheus.metrics.core...

Opengraph URL: https://github.com/prometheus/client_java/issues/2292

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Summary quantiles collapse to the minimum observation when 2·epsilon ≥ 1−quantile","articleBody":"## Version\n\n`io.prometheus:prometheus-metrics-core:1.8.0` (the affected code in `CKMSQuantiles` is\nunchanged since at least 1.3.x and is still present on `main`).\n\n## Reproducer\n\n```java\nimport io.prometheus.metrics.core.metrics.Summary;\nimport io.prometheus.metrics.model.registry.PrometheusRegistry;\nimport io.prometheus.metrics.model.snapshots.Quantile;\nimport io.prometheus.metrics.model.snapshots.SummarySnapshot;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Random;\n\npublic class SummaryQuantileBugRepro {\n\n  public static void main(String[] args) {\n    Summary summary =\n        Summary.builder()\n            .name(\"request_latency\")\n            .help(\"reproducer\")\n            .quantile(0.9, 0.05)\n            .quantile(0.99, 0.005)\n            .register(new PrometheusRegistry());\n\n    // observe the values 1..100_000 shuffled, so the true p90 is 90_000 and p99 is 99_000\n    List\u003cInteger> values = new ArrayList\u003c>();\n    for (int i = 1; i \u003c= 100_000; i++) {\n      values.add(i);\n    }\n    Collections.shuffle(values, new Random(42));\n    for (int v : values) {\n      summary.observe(v);\n    }\n\n    SummarySnapshot.SummaryDataPointSnapshot dataPoint = summary.collect().getDataPoints().get(0);\n    for (Quantile q : dataPoint.getQuantiles()) {\n      System.out.printf(\n          \"quantile %.2f: reported = %10.1f, expected ~ %10.1f%n\",\n          q.getQuantile(), q.getValue(), q.getQuantile() * 100_000);\n    }\n  }\n}\n```\n\nOutput with 1.8.0:\n\n```\nquantile 0.90: reported =        1.0, expected ~    90000.0\nquantile 0.99: reported =        1.0, expected ~    99000.0\n```\n\nBoth quantiles report the **minimum** of all 100,000 observations. The result does not\ndepend on the input distribution or the shuffle seed. A single targeted quantile\n`quantile(0.99, 0.005)` reproduces it too.\n\n## How we found it\n\nIn our application we had\n\n```java\n.quantile(0.9, 0.05)\n.quantile(0.99, 0.005)\n```\n\non a latency Summary. It reported `p90 == p99 == 0.6ms` while a\nclassic `Histogram` fed by the same observations (cross-checked against an in-process\nexact-percentile counter) showed p90 = 2ms, p99 = 44ms. The reported value was below the\ntrue median. Adding a `.quantile(0.5, 0.05)` softens the failure but doesn't fix it: get(0.99)\nthen returns a value from around the 85th percentile.\n\n## Observations\n\n`CKMSQuantiles`:\n\n1. **`compress()` destroys the sketch.** The error function from the CKMS paper\n   (definition 5) allows a sample below a target `(q, ε)` at rank `r` to have width\n   `2ε(n−r)/(1−q)`. When `2ε ≥ 1−q` — which holds with equality for both `(0.9, 0.05)` and\n   `(0.99, 0.005)` — this is `≥ n−r`: one sample may span every rank from `r` to `n`.\n   `compress()` then merges away everything between the middle of the distribution and the\n   maximum; the sample list collapses to just a few samples no matter how many values are inserted.\n\n2. **`get()` stops at the first wide sample.** The scan stops at the first sample with\n   `r + g + delta > desiredRank + f(desiredRank)/2` and returns the previous sample's value.\n   That rule is only correct when `g + delta` is small for all samples up to the target\n   rank. Below a targeted quantile, deltas may legally be of order `n` — and freshly\n   inserted samples get `delta = f(r) − 1` while `get()` flushes the insert buffer right\n   before scanning, so maximally-wide fresh samples are always present at query time. The\n   scan therefore stops far before the target rank.\n\n## Tightening error/epsilon avoids the issue\n\nThe tight-epsilon (0.01 for p90, 0.001 for p99) Summary agrees with the histogram-derived p99,\nwhile the identically-fed boundary-epsilon (0.05 for p90, 0.005 for p99) Summaries report `p90 == p99` from\nthe very same measurements. So the failure is fully determined by the quantile\nconfiguration, not by the data.\n\n## Side note\n\nI have a fix with reproducer tests ready and happy to open a PR:  \nit bounds merges in compress() so a sample can never span across the accuracy window of a target quantile, \nand changes get() to select the sample whose rank interval is centered closest to the desired rank.\nWith the reproducer config, get(0.99) goes from returning the minimum observation to a rank-accurate value.\nThe full existing test suite passes.\n\n\n\n","author":{"url":"https://github.com/olegkovalenko","@type":"Person","name":"olegkovalenko"},"datePublished":"2026-07-08T13:15:37Z","url":"https://github.com/prometheus/client_java/issues/2292"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8c4ea5f0-b958-ade5-15bc-30cadddbdb29
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D9A:5C806:4B894:644D6:6AFBA2FA
html-safe-nonce3dd24aa1c8dccd8a5d2bed5752078b4f9328fa6806179949e228f43e20078e97
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDlBOjVDODA2OjRCODk0OjY0NEQ2OjZBRkJBMkZBIiwidmlzaXRvcl9pZCI6IjUwMjUzMzk3Nzk0MDM0NTcyNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf3abfdba0799f78f20f945dd8a3e93365157ae703d40e646e8c410a5b9f379b4
hovercard-subject-tagissue:4837798559
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/prometheus/client_java/2292/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1b4e0eda18592f9c7ce27d41d4a5d5fa97e467b6368eeb34199b3cf84ac73655/prometheus/client_java/issues/2292
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1b4e0eda18592f9c7ce27d41d4a5d5fa97e467b6368eeb34199b3cf84ac73655/prometheus/client_java/issues/2292
og:image:altVersion io.prometheus:prometheus-metrics-core:1.8.0 (the affected code in CKMSQuantiles is unchanged since at least 1.3.x and is still present on main). Reproducer import io.prometheus.metrics.core...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameolegkovalenko
hostnamegithub.com
expected-hostnamegithub.com
None03e5090f0cea887cafa036e3af34d7c668d83b5e9e9e03df72a90efb49b69cdf
turbo-cache-controlno-preview
go-importgithub.com/prometheus/client_java git https://github.com/prometheus/client_java.git
octolytics-dimension-user_id3380462
octolytics-dimension-user_loginprometheus
octolytics-dimension-repository_id7997879
octolytics-dimension-repository_nwoprometheus/client_java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7997879
octolytics-dimension-repository_network_root_nwoprometheus/client_java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release41f00295b9a35dca977890ab83b22788ab211dc8
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/prometheus/client_java/issues/2292#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_java%2Fissues%2F2292
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_java%2Fissues%2F2292
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=prometheus%2Fclient_java
Reloadhttps://github.com/prometheus/client_java/issues/2292
Reloadhttps://github.com/prometheus/client_java/issues/2292
Reloadhttps://github.com/prometheus/client_java/issues/2292
prometheushttps://github.com/prometheus
client_javahttps://github.com/prometheus/client_java
Codehttps://github.com/prometheus/client_java
Issues12 (12)https://github.com/prometheus/client_java/issues
Pull requests18 (18)https://github.com/prometheus/client_java/pulls
Actionshttps://github.com/prometheus/client_java/actions
Projectshttps://github.com/prometheus/client_java/projects
Security and qualityhttps://github.com/prometheus/client_java/security
Insightshttps://github.com/prometheus/client_java/pulse
https://github.com/prometheus/client_java
New issuehttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2292
New issuehttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2292
#2396https://github.com/prometheus/client_java/pull/2396
Summary quantiles collapse to the minimum observation when 2·epsilon ≥ 1−quantilehttps://github.com/prometheus/client_java/issues/2292#top
#2396https://github.com/prometheus/client_java/pull/2396
https://github.com/olegkovalenko
olegkovalenkohttps://github.com/olegkovalenko
on Jul 8, 2026https://github.com/prometheus/client_java/issues/2292#issue-4837798559
https://github.com/Develop-KIM
Develop-KIMhttps://github.com/Develop-KIM
on Aug 19, 2026https://github.com/prometheus/client_java/issues/2292#issuecomment-5336039592
@olegkovalenkohttps://github.com/olegkovalenko
https://github.com/olegkovalenko
olegkovalenkohttps://github.com/olegkovalenko
on Aug 19, 2026https://github.com/prometheus/client_java/issues/2292#issuecomment-5340555211
#2316https://github.com/prometheus/client_java/pull/2316
#2316https://github.com/prometheus/client_java/pull/2316
olegkovalenkohttps://github.com/olegkovalenko
on Aug 19, 2026https://github.com/prometheus/client_java/issues/2292#event-29683570295
fix: Summary quantiles collapsing for targeted quantiles with 2*epsil…https://github.com/olegkovalenko/client_java/commit/2e86dac2c1bad79c34e062a4d3cefdf1976e8452
https://docs.github.com/articles/closing-issues-via-commit-messages
2e86dachttps://github.com/olegkovalenko/client_java/commit/2e86dac2c1bad79c34e062a4d3cefdf1976e8452
https://github.com/Develop-KIM
Develop-KIMhttps://github.com/Develop-KIM
on Aug 20, 2026https://github.com/prometheus/client_java/issues/2292#issuecomment-5351843425
#2316https://github.com/prometheus/client_java/pull/2316
zeitlingerhttps://github.com/zeitlinger
completedhttps://github.com/prometheus/client_java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#2396https://github.com/prometheus/client_java/pull/2396
on Aug 25, 2026https://github.com/prometheus/client_java/issues/2292#event-29968557841
pullhttps://github.com/apps/pull
on Aug 25, 2026https://github.com/prometheus/client_java/issues/2292#event-29981558770
fix: Summary quantiles collapsing for targeted quantiles with 2*epsil…https://github.com/Hawthorne001/client_java/commit/9c7479fd11beadd70a7c7ea76d40b70f1e3dcc8c
https://docs.github.com/articles/closing-issues-via-commit-messages
9c7479fhttps://github.com/Hawthorne001/client_java/commit/9c7479fd11beadd70a7c7ea76d40b70f1e3dcc8c
Sign up for freehttps://github.com/signup?return_to=https://github.com/prometheus/client_java/issues/2292
Sign in to commenthttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2292
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.