Skip to content

feat: bind exposition writers to negotiated escaping - #2642

Draft
zeitlinger wants to merge 5 commits into
mainfrom
fix/negotiated-exposition
Draft

zeitlinger wants to merge 5 commits into
mainfrom
fix/negotiated-exposition

Conversation

@zeitlinger

@zeitlinger zeitlinger commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

I added an immutable ExpositionFormatWriterWithEscaping wrapper and a factory that binds the selected format to the escaping scheme negotiated from the Accept header. The scrape handler now uses the negotiated writer, while the existing writer API and standard content types remain unchanged. Fixes #1577.

I added the generated API diff report and normalized its generator to omit trailing blank lines rejected by lint. Lint and unit tests pass. The local mise run build reached integration tests but Docker/Testcontainers failures prevented the full build; the install build with integration tests skipped passed.

I also documented manual negotiated responses in the Formats guide.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — maintainer review required

This PR modifies the published API diff for the following module(s):

  • prometheus-metrics-exposition-textformats

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escaping API inconsistencies

1 participant