Page MenuHomeSoftware Heritage

Expose counters in prometheus format
Closed, MigratedEdits Locked

Description

According the the initial proposal [1], prometheus will remain the historical reference of the counter values.
swh-counters needs to expose an api endpoint to allow prometheus to retrieve and store them in a timeseries.

[1] https://hedgedoc.softwareheritage.org/UHZYNPrAS_q6LhgwT5UhoQ#target-proposal

Event Timeline

vsellier triaged this task as Normal priority.Mar 22 2021, 5:50 PM
vsellier created this task.
vsellier changed the task status from Open to Work in Progress.Mar 24 2021, 10:08 AM

The current serie were the counters are stored is named sql_swh_archive_object_count, the serie for swh-counters could be swh_archive_object_count

The current tag are:

  • content
  • directory
  • origin
  • origin-visit
  • person
  • release
  • revision
  • skipped_content
  • snapshot

All these tag can be computed by swh-counters except person, not exposed in a kafka topic.

The counters are now exposed throught a /metrics enpoint and ingested by prometheus.
They are well tagged per environment so we will be able to isolate the counters for each one:

ElementValue
swh_archive_object_total{col="value",environment="staging",instance="counters0.internal.staging.swh.network",job="swh-counters",object_type="content"}150059502
swh_archive_object_total{col="value",environment="staging",instance="counters0.internal.staging.swh.network",job="swh-counters",object_type="origin"}581640
swh_archive_object_total{col="value",environment="staging",instance="counters0.internal.staging.swh.network",job="swh-counters",object_type="revision"}31682911

The diff D5332 will allow to monitor the others topics