devsisters / shardcake

Sharding and location transparency for Scala
https://devsisters.github.io/shardcake/
Apache License 2.0
382 stars 29 forks source link

Metrics not parsable by Prometheus #122

Closed clayroach closed 3 months ago

clayroach commented 3 months ago

Prometheus metrics scraper fails to pick up any metrics from the pods - chokes on the sharding.entities metric type and the others. Per docs:

Metric names may contain ASCII letters, digits, underscores, and colons. It must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.

Simple fix is to change to:

object Metrics {
  val shards: Gauge[Double]     = Metric.gauge("shardcake_shards")
  val entities: Gauge[Double]   = Metric.gauge("shardcake_entities")
  val singletons: Gauge[Double] = Metric.gauge("shardcake_singletons")
}
clayroach commented 3 months ago

Branch is ready if you want me to create a PR.

ghostdogpr commented 3 months ago

I actually fixed that in zio-metrics: https://github.com/zio/zio-metrics-connectors/releases/tag/v2.3.1 (we wanted to keep using dots because we expose to Datadog as well).

clayroach commented 3 months ago

Perfect, thx. Will close and update zio metrics!