Skip to content

Prometheus metrics for pipeline tracking#336

Open
chrisarridge wants to merge 1 commit into
livefrom
ca/add-status-tracking-prom-metrics
Open

Prometheus metrics for pipeline tracking#336
chrisarridge wants to merge 1 commit into
livefrom
ca/add-status-tracking-prom-metrics

Conversation

@chrisarridge

@chrisarridge chrisarridge commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This PR adds a few prom metrics to track the duration of different parts of the datastore pipeline. These are triggered and computed when the management command changes rows in the db_status from an active to an inactive (IDLE or READY) state:

  • datastore_last_run_datagetter_duration_seconds
  • datastore_last_run_datastore_load_duration_seconds
  • datastore_last_run_grantnav_package_build_duration_seconds
  • datastore_last_run_monitoring_snapshot_duration_seconds

This will give us timeseries of the performance of different parts of the pipeline which will hopefully help to debug and optimise the pipeline.

In addition, a metric is added to contain the time since the last data package was built (datastore_time_since_last_grantnav_data_package_build_seconds). This is designed to allow us to retire the datastore-package-monitor currently running on the monitoring server as that script and cron job can be replaced with a prom alert when this gauge exceeds, for example, 14 hours.

I've also added some logging to try to debug a current issue in the datastore where the metrics endpoint does not appear to be responding.

This commit adds a few prom metrics to track the duration of different
parts of the datastore pipeline.  These are triggered and computed when
rows in the db_status table change from an active to an inactive (IDLE
or READY) state.  In addition, a metric is added to contain the time
since the last data package was built.
@chrisarridge chrisarridge requested review from BibianaC and Bjwebb June 16, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant