capabilities.work

Manage a Grouped Metric Group End to End

A 4-step recipe with Prometheus. We can help you get access.

Recipe · 4 steps

Manage a Grouped Metric Group End to End

Full lifecycle of a metric group identified by job plus grouping labels.

  1. Atomically replace this worker's group. Because the group is keyed on job plus the grouping labels, this touches only this worker and leaves every sibling worker's group intact.
  2. Update a subset of the metrics in the group. POST preserves the metrics already in the group, which is what makes progress reporting from a long-running worker possible without re-sending everything.
  3. Read back the stored groups and confirm this worker's group carries both the replaced metrics and the update, under the expected label set.
  4. Delete this worker's group at teardown. Only the group with this exact label set is removed. Skipping this is what leaves a decommissioned worker's last values being scraped indefinitely as though they were live.
What you'll need to have ready
  • jobName: The job label for this metric group (e.g. batch-importer).
  • groupingLabels: Additional grouping labels as alternating label-name/label-value path segments (e.g. instance/server01 or instance/host1/datacenter/eu).
  • metricsPayload: The worker's metrics in Prometheus text exposition format, with a trailing newline.
  • updatePayload: A subset of metrics in text exposition format to update within the existing group without replacing it.
For your developer

Arazzo workflow prometheus:push-grouped-metrics-lifecycle, 4 operations: replaceGroupedMetrics → pushGroupedMetrics → listAllMetrics → deleteGroupedMetrics. Specs on APIs.io.