René's URL Explorer Experiment


Title: Proposal: Prometheus HTTP API client module (prometheus-metrics-api-client) · Issue #2306 · prometheus/client_java · GitHub

Open Graph Title: Proposal: Prometheus HTTP API client module (prometheus-metrics-api-client) · Issue #2306 · prometheus/client_java

X Title: Proposal: Prometheus HTTP API client module (prometheus-metrics-api-client) · Issue #2306 · prometheus/client_java

Description: What A new module — working name prometheus-metrics-api-client — providing a typed Java client for the Prometheus HTTP API (/api/v1/*): instant and range queries, series / labels / metadata, with a typed result model (vector / matrix / s...

Open Graph Description: What A new module — working name prometheus-metrics-api-client — providing a typed Java client for the Prometheus HTTP API (/api/v1/*): instant and range queries, series / labels / metadata, with a...

X Description: What A new module — working name prometheus-metrics-api-client — providing a typed Java client for the Prometheus HTTP API (/api/v1/*): instant and range queries, series / labels / metadata, with a...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Prometheus HTTP API client module (prometheus-metrics-api-client)","articleBody":"### What\n\nA new module — working name `prometheus-metrics-api-client` — providing a typed Java client for the Prometheus HTTP API (`/api/v1/*`): instant and range queries, series / labels / metadata, with a typed result model (vector / matrix / scalar / string).\n\n### Why revisit this\n\nI'm aware querying has historically been considered out of scope here (#816, #841 — \"client_java is for exposing metrics\"). Three reasons I think it's worth revisiting:\n\n**1. The reference Go client already ships one.** [`client_golang/api/prometheus/v1`](https://github.com/prometheus/client_golang/tree/main/api/prometheus/v1) provides `Query`, `QueryRange`, `Series`, `LabelNames`, `LabelValues`, `Metadata`, `Rules`, `Targets` and more, inside the official client library. So \"client libraries are instrumentation-only\" isn't consistent across official Prometheus clients — Go users get an API client out of the box, JVM users don't.\n\n**2. There is no maintained JVM alternative, so everyone hand-rolls.** GitHub code search for `\"api/v1/query_range\" language:Java` returns ~350 files. A sample of projects each maintaining their own HTTP + JSON model code for the same API: LinkedIn [Cruise Control](https://github.com/linkedin/cruise-control/tree/main/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/monitor/sampling/prometheus), Spinnaker [Kayenta](https://github.com/spinnaker/kayenta/blob/master/kayenta-prometheus/src/main/java/com/netflix/kayenta/prometheus/service/PrometheusRemoteService.java), [OpenSearch SQL](https://github.com/opensearch-project/sql/blob/main/direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java), [YugabyteDB](https://github.com/yugabyte/yugabyte-db/blob/master/managed/src/main/java/com/yugabyte/yw/metrics/MetricQueryHelper.java), [Apache SeaTunnel](https://github.com/apache/seatunnel/tree/dev/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus), [Kruize](https://github.com/kruize/autotune/blob/master/src/main/java/com/autotune/common/datasource/prometheus/PrometheusDataOperatorImpl.java), [DataStax Fallout](https://github.com/datastax/fallout/tree/master/src/main/java/com/datastax/fallout/components/metrics). The third-party libraries that exist are unmaintained one-person projects:\n\n- [mckang/promql_java_client](https://github.com/mckang/promql_java_client) — the closest thing to a full client (★89), but a single-contributor project: essentially all code dates from 2022, with sporadic commits since.\n- [DanielMager/PrometheusQueries4J](https://github.com/DanielMager/PrometheusQueries4J) — single contributor, no commits since 2022.\n- [HolgerZhang/promql-builder](https://github.com/HolgerZhang/promql-builder) — PromQL query-string builder only, no HTTP/JSON layer.\n- …plus assorted single-author experiments ([PromQLGenerator](https://github.com/BohrX/PromQLGenerator), [PQLetta](https://github.com/byzatic/PQLetta)).\n\n**3. Hand-rolling keeps producing the same spec-compliance bugs.** Current example: [linkedin/cruise-control#2389](https://github.com/linkedin/cruise-control/issues/2389) — timestamps formatted via `Double.toString()` come out in scientific notation (`start=1.784144612388E9`). Prometheus happens to accept that (Go's lenient `ParseFloat`), but stricter API-compatible backends (VictoriaMetrics) reject it with 422. A shared, well-tested client fixes this class of bug once for the whole ecosystem instead of once per project.\n\n### Proposed scope (v1)\n\n- Endpoints: `query`, `query_range`, `series`, `labels`, `label/\u003cname>/values`, `metadata` — the subset that virtually every hand-rolled client reimplements; `client_golang`'s surface as the ceiling, added on demand.\n- Typed result model: vector / matrix / scalar / string; spec-compliant request encoding (plain-decimal or RFC 3339 timestamps, POST for long queries).\n- Auth: basic, bearer token, custom headers (e.g. `X-Scope-OrgID` for Mimir), TLS config.\n- Dependencies: aiming for zero new runtime deps, in the spirit of `prometheus-metrics-exporter-httpserver`. Open questions below.\n- Integration tests against Prometheus and API-compatible backends (VictoriaMetrics, Mimir, Thanos) via testcontainers, since compatibility differences are exactly where hand-rolled clients break.\n\n### Open questions\n\n1. Minimum JDK for the module: `java.net.http.HttpClient` needs 11+; if the module must stay on 8, `HttpURLConnection`.\n2. JSON parsing without adding a dependency to the BOM: a minimal internal parser vs an optional `-jackson` binding module.\n3. Module naming: `prometheus-metrics-api-client` vs something clearer about direction (`prometheus-query-client`?).\n\n### Offer\n\nI'm willing to contribute the initial implementation, tests, and docs, and to help maintain the module afterwards. Before writing code I'd like to hear whether maintainers would consider this in scope at all — and if the answer is no, whether you'd accept a documentation pointer to a community-maintained library instead, so the next person doesn't hand-roll client №351.\n\n","author":{"url":"https://github.com/gecube","@type":"Person","name":"gecube"},"datePublished":"2026-07-16T02:05:11Z","url":"https://github.com/prometheus/client_java/issues/2306"}

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:049055d0-88e5-e5e0-28b6-1094dcbee55b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC3E4:39495A:46BA5:62AF6:6AFBB5EA
html-safe-nonceedaba3e36b5e3fcde94eb881f2ecd0ffb370ffe9d6a2d944a6c0de68068b4766
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0U0OjM5NDk1QTo0NkJBNTo2MkFGNjo2QUZCQjVFQSIsInZpc2l0b3JfaWQiOiI1ODc1OTE4ODM1MDI5ODgyMzQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0837f856f83e8776c12ad95fc6fe9acb55b745f50a05b6ae460cac9b9aea3bd7
hovercard-subject-tagissue:4897991906
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/2306/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d72e0fb324a2398ab075633b5501180027c17781fe6f6a704bc7414eaf27029b/prometheus/client_java/issues/2306
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d72e0fb324a2398ab075633b5501180027c17781fe6f6a704bc7414eaf27029b/prometheus/client_java/issues/2306
og:image:altWhat A new module — working name prometheus-metrics-api-client — providing a typed Java client for the Prometheus HTTP API (/api/v1/*): instant and range queries, series / labels / metadata, with a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegecube
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
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
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/prometheus/client_java/issues/2306#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_java%2Fissues%2F2306
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%2F2306
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/2306
Reloadhttps://github.com/prometheus/client_java/issues/2306
Reloadhttps://github.com/prometheus/client_java/issues/2306
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/2306
New issuehttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2306
Proposal: Prometheus HTTP API client module (prometheus-metrics-api-client)https://github.com/prometheus/client_java/issues/2306#top
https://github.com/gecube
gecubehttps://github.com/gecube
on Jul 16, 2026https://github.com/prometheus/client_java/issues/2306#issue-4897991906
#816https://github.com/prometheus/client_java/issues/816
#841https://github.com/prometheus/client_java/issues/841
client_golang/api/prometheus/v1https://github.com/prometheus/client_golang/tree/main/api/prometheus/v1
Cruise Controlhttps://github.com/linkedin/cruise-control/tree/main/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/monitor/sampling/prometheus
Kayentahttps://github.com/spinnaker/kayenta/blob/master/kayenta-prometheus/src/main/java/com/netflix/kayenta/prometheus/service/PrometheusRemoteService.java
OpenSearch SQLhttps://github.com/opensearch-project/sql/blob/main/direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java
YugabyteDBhttps://github.com/yugabyte/yugabyte-db/blob/master/managed/src/main/java/com/yugabyte/yw/metrics/MetricQueryHelper.java
Apache SeaTunnelhttps://github.com/apache/seatunnel/tree/dev/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus
Kruizehttps://github.com/kruize/autotune/blob/master/src/main/java/com/autotune/common/datasource/prometheus/PrometheusDataOperatorImpl.java
DataStax Fallouthttps://github.com/datastax/fallout/tree/master/src/main/java/com/datastax/fallout/components/metrics
mckang/promql_java_clienthttps://github.com/mckang/promql_java_client
DanielMager/PrometheusQueries4Jhttps://github.com/DanielMager/PrometheusQueries4J
HolgerZhang/promql-builderhttps://github.com/HolgerZhang/promql-builder
PromQLGeneratorhttps://github.com/BohrX/PromQLGenerator
PQLettahttps://github.com/byzatic/PQLetta
linkedin/cruise-control#2389https://github.com/linkedin/cruise-control/issues/2389
https://github.com/zeitlinger
zeitlingerhttps://github.com/zeitlinger
on Jul 16, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-4994438042
https://prometheus.io/community/#calendar-for-public-eventshttps://prometheus.io/community/#calendar-for-public-events
https://github.com/arnabnandy7
arnabnandy7https://github.com/arnabnandy7
on Jul 18, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5011052488
@gecubehttps://github.com/gecube
@zeitlingerhttps://github.com/zeitlinger
https://github.com/jaydeluca
jaydelucahttps://github.com/jaydeluca
on Jul 18, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5011065015
https://github.com/arnabnandy7
arnabnandy7https://github.com/arnabnandy7
on Jul 18, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5011069491
https://github.com/gecube
gecubehttps://github.com/gecube
on Jul 18, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5011101201
@arnabnandy7https://github.com/arnabnandy7
@jaydelucahttps://github.com/jaydeluca
https://github.com/arnabnandy7
arnabnandy7https://github.com/arnabnandy7
on Jul 18, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5011105161
@arnabnandy7https://github.com/arnabnandy7
@jaydelucahttps://github.com/jaydeluca
gecubehttps://github.com/gecube
on Jul 18, 2026https://github.com/prometheus/client_java/issues/2306#event-28163982342
feat: add prometheus-metrics-api-client, a typed Prometheus HTTP API …https://github.com/gecube/client_java/commit/39eaa5ae564b94be7064f0540b7705f9fe4b0999
39eaa5ahttps://github.com/gecube/client_java/commit/39eaa5ae564b94be7064f0540b7705f9fe4b0999
https://github.com/gecube
gecubehttps://github.com/gecube
on Jul 26, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5084813617
@jaydelucahttps://github.com/jaydeluca
https://github.com/gecube/client_java/tree/api-client-modulehttps://github.com/gecube/client_java/tree/api-client-module
main...gecube:client_java:api-client-modulehttps://github.com/prometheus/client_java/compare/main...gecube:client_java:api-client-module
client_golang/api/prometheus/v1https://github.com/prometheus/client_golang/tree/main/api/prometheus/v1
PrometheusMetricSampler emits query timestamps in scientific notation, breaking strict Prometheus-compatible backends (VictoriaMetrics 422) cruise-control-for-kafka/cruise-control#2389https://github.com/cruise-control-for-kafka/cruise-control/issues/2389
LinkedIn Cruise Controlhttps://github.com/linkedin/cruise-control
@arnabnandy7https://github.com/arnabnandy7
https://github.com/arnabnandy7
arnabnandy7https://github.com/arnabnandy7
on Jul 26, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5084824159
https://github.com/jaydeluca
jaydelucahttps://github.com/jaydeluca
on Jul 31, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5142348039
@gecubehttps://github.com/gecube
https://github.com/jaydeluca
jaydelucahttps://github.com/jaydeluca
on Sep 22, 2026https://github.com/prometheus/client_java/issues/2306#issuecomment-5784108678
Sign up for freehttps://github.com/signup?return_to=https://github.com/prometheus/client_java/issues/2306
Sign in to commenthttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2306
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.