Skip to content

Prometheus formatting support + refactor#15

Merged
mkuratczyk merged 12 commits intomainfrom
prometheus-support
Jul 18, 2025
Merged

Prometheus formatting support + refactor#15
mkuratczyk merged 12 commits intomainfrom
prometheus-support

Conversation

@mkuratczyk
Copy link
Contributor

@mkuratczyk mkuratczyk commented May 14, 2025

  • add new/4 which allows attaching labels to counters
  • add format/2 to allow different formatting options
  • add prom_format/2,3 to return a Prometheues exposition format binary

Refactors including:

  • renaming arguments for consistency
  • adding specs
  • adding edocs
  • eunit -> CT
  • erlang.mk update

* add new/4 which allows attaching labels to counters
* add format/2 to only formal a subset of metrics
* add prom_format/2,3 to return a Prometheues exposition format binary

Refactors including:
* renaming arguments for consistency
* adding specs
* adding edocs
* eunit -> CT
* erlang.mk update
@mkuratczyk mkuratczyk force-pushed the prometheus-support branch from 94dbf1d to 675c680 Compare May 14, 2025 10:43
Additionally, store the rendered labels as a bitstring,
to avoid converting a map to a bitstring on every scrape.
This gives ~30% scrape speed-up with a large number of metrics.
@mkuratczyk mkuratczyk force-pushed the prometheus-support branch from 270dfed to 2c0f458 Compare June 2, 2025 18:07
@mkuratczyk mkuratczyk force-pushed the prometheus-support branch 2 times, most recently from cab7ec5 to 080e94e Compare June 4, 2025 08:29
eunit_formatters no longer needed
@mkuratczyk mkuratczyk force-pushed the prometheus-support branch from 080e94e to 979d83c Compare June 4, 2025 08:42
* more consistent naming
* better formatting
* different order of things
@mkuratczyk mkuratczyk force-pushed the prometheus-support branch from 253e9ae to aec4c4e Compare June 4, 2025 14:02
Copy link
Contributor

@kjnilsson kjnilsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few formatting comments + an API change to consider.

@mkuratczyk mkuratczyk force-pushed the prometheus-support branch from 8f8cdb7 to 49ae049 Compare June 6, 2025 08:23
@mkuratczyk mkuratczyk marked this pull request as ready for review June 9, 2025 14:00
@mkuratczyk mkuratczyk requested a review from kjnilsson June 9, 2025 14:00
@mkuratczyk mkuratczyk merged commit 635e02c into main Jul 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants