zio / zio-zmx

Monitoring, Metrics and Diagnostics for ZIO
https://zio.github.io/zio-zmx/
Apache License 2.0
85 stars 47 forks source link

Migrate Prometheus Metric Client to ZIO 2.0 #302

Closed adamgfraser closed 3 years ago

adamgfraser commented 3 years ago

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] =
    ???
}
atooni commented 3 years ago

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