Title: Escaping API inconsistencies · Issue #1577 · prometheus/client_java · GitHub
Open Graph Title: Escaping API inconsistencies · Issue #1577 · prometheus/client_java
X Title: Escaping API inconsistencies · Issue #1577 · prometheus/client_java
Description: If I understand correctly, this is approximately how I should produce an output: expositionFormats.findWriter(accept) .write(System.out, registry.scrape(), EscapingScheme.fromAcceptHeader(accept)); The problem with this is that the API f...
Open Graph Description: If I understand correctly, this is approximately how I should produce an output: expositionFormats.findWriter(accept) .write(System.out, registry.scrape(), EscapingScheme.fromAcceptHeader(accept));...
X Description: If I understand correctly, this is approximately how I should produce an output: expositionFormats.findWriter(accept) .write(System.out, registry.scrape(), EscapingScheme.fromAcceptHeader(accept));...
Opengraph URL: https://github.com/prometheus/client_java/issues/1577
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Escaping API inconsistencies","articleBody":"If I understand correctly, this is approximately how I should produce an output:\n```java\nexpositionFormats.findWriter(accept)\n .write(System.out, registry.scrape(), EscapingScheme.fromAcceptHeader(accept));\n```\n\nThe problem with this is that the API forces me to pass the accept header twice, so theoretically I can do this:\n```java\nexpositionFormats.findWriter(acceptHeaderOne)\n .write(System.out, registry.scrape(), EscapingScheme.fromAcceptHeader(acceptHeaderTwo));\n```\nWhich can lead to inconsistencies, it is easy to misuse the API.\nI'm wondering if something like this would make sense:\n```java\nexpositionFormats.findWriter(accept).write(System.out, registry.scrape());\n```\nand the writer would have the `EscapingScheme`.\nThe writer still can be cached but it would be a little more than today.","author":{"url":"https://github.com/jonatan-ivanov","@type":"Person","name":"jonatan-ivanov"},"datePublished":"2025-09-19T03:03:05Z","url":"https://github.com/prometheus/client_java/issues/1577"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf484710-16b2-979c-aa4c-2f361cb2b5c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C0E:ABEA3:2564CE:318CD6:6AFBB514 |
| html-safe-nonce | 192e23154d203b816c5cbc925549c28652034cca3d04610070b5728764393e9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzBFOkFCRUEzOjI1NjRDRTozMThDRDY6NkFGQkI1MTQiLCJ2aXNpdG9yX2lkIjoiNzM4NjY0MDcwNzcxODE5ODU0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8feae4804066a1040966f2d46cffabf41d31e34ce4d7f111e872bf62c2578d15 |
| hovercard-subject-tag | issue:3432551245 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/prometheus/client_java/1577/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0ef273b23878afdbffe231934494a4f37b8f32200f30181955aa2621712635ed/prometheus/client_java/issues/1577 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0ef273b23878afdbffe231934494a4f37b8f32200f30181955aa2621712635ed/prometheus/client_java/issues/1577 |
| og:image:alt | If I understand correctly, this is approximately how I should produce an output: expositionFormats.findWriter(accept) .write(System.out, registry.scrape(), EscapingScheme.fromAcceptHeader(accept));... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jonatan-ivanov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/prometheus/client_java git https://github.com/prometheus/client_java.git |
| octolytics-dimension-user_id | 3380462 |
| octolytics-dimension-user_login | prometheus |
| octolytics-dimension-repository_id | 7997879 |
| octolytics-dimension-repository_nwo | prometheus/client_java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7997879 |
| octolytics-dimension-repository_network_root_nwo | prometheus/client_java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width