zio/zio-zmx

Migrate Prometheus Metric Client to ZIO 2.0

Closed this issue · 1 comments

This ticket is to migrate the existing implementation of the Prometheus metric client to ZIO 2.0. The metric client will call the MetricClient.unsafeSnapshot method from ZIO 2.0 here to obtain a snapshot of all metrics in the application at the request of the user. The functionality to start up and shut down the client should be encompassed in a ZIOApp that can be composed with other ZIOApp values using the <> operator on ZIOApp.

object MetricClient {

  /**
   * Unsafely captures a snapshot of all metrics recorded by the application.
   */
  final def unsafeSnapshot: Map[MetricKey, MetricState] =
    ???
}

The code has been migrated - We need to enhance the test suite to make sure that we are meeting the Prometheus specification for exposing metrics.

See also #317