Skip to content

feat: allow to encode a registry in openmetrics without EOF #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Frando
Copy link
Member

@Frando Frando commented May 21, 2025

Description

MetricsSource::encode_openmetrics adds the # EOF\n marker at the end of the encoded openmetrics output. This is the expected last characters in the openmetrics text format. Currently, MetricsSource::encode_openmetrics is the only public API to encode a iroh_metrics::Registry into the openmetrics text format.

When combining output from different sources, users should be able to add the EOF marker themselves. This PR adds a public function Registry::encode_openmetrics_to_writer that encodes without the EOF.

For 1.0 we should revisit the MetricsSource trait, but the change in this PR is semver compatible so can be in a patch release, so that downstream users of [email protected] can make use of it.

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

github-actions bot commented May 21, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-metrics/pr/27/docs/iroh_metrics/

Last updated: 2025-05-22T10:27:04Z

@n0bot n0bot bot added this to iroh May 21, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh May 21, 2025
@Frando Frando force-pushed the Frando/encode-skip-eof branch from 7f0b45c to 07ede08 Compare May 21, 2025 21:21
@Frando Frando requested review from dignifiedquire and Arqu May 21, 2025 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant