Skip to content

Commit

Permalink
refactor: add typesafe wrappers for prom client metrics (#5969)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-1856/add-typesafe-wrappers-over-prom-clients-metrics

As discussed on the latest knowledge sharing session, this adds typesafe
wrappers over prom client's metrics, requiring us to specify all the
configured labels for each metric.

This uses a functional approach and only exposes the methods that are
currently relevant to us, while also exposing the underlying instance of
the metric for an easy access if needed.

Since we often chain `labels` with `inc` in counters, this adds a
convenience `increment` method for counters which does both in a single
call.
  • Loading branch information
nunogois authored Jan 19, 2024
1 parent 77fcc9e commit 5253482
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 84 deletions.
Loading

0 comments on commit 5253482

Please sign in to comment.