Skip to content

Commit

Permalink
fix: gtfs-api: fix gtfs_data_imported_at metric's format
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Jan 4, 2025
1 parent a71503f commit c2d7cb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- `dagster-pipeline`/`dagster-daemon`/`dagster-dagit`: upgrade to [`2024-12-03t09-35`](https://github.com/mobidata-bw/ipl-dagster-pipeline/blob/7ceecb4f622dc3a6ac9e6a3179885b4d17b62301/CHANGELOG.md#2024-12-03)
- `lamassu`: upgraded [`lamassu`](https://github.com/entur/lamassu) to [2024-12-17T19-37](https://hub.docker.com/layers/entur/lamassu/2024-12-17T19-37/images/sha256-7fb67b8f7a7395a9ec726dda7ed411679ef900fe0c4f3ec2da636cd4da5f603a). This i.e. includes immediate update after successful feed subscription (https://github.com/entur/lamassu/pull/592). As consequence, `X2GBFS_HEALTHCHECK_START_INTERVAL` is not necessary any longer and has been removed.
- `gtfs-api`: fix `gtfs_data_imported_at` Prometheus metric:
- fix the format
- grant access to the PostgreSQL function to PostgREST
- move `text/plain` PostgreSQL domain into the `api` schema

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE OR REPLACE FUNCTION api.gtfs_data_imported_at_metric ()
RETURNS api."text/plain"
AS $$
SELECT E'# HELP gtfs_data_imported_at when the GTFS data has been imported\n# TYPE gtfs_data_imported_at gauge\ngtfs_data_imported_at=' || floor(EXTRACT(EPOCH FROM api.gtfs_data_imported_at())) || E'\n';
SELECT E'# HELP gtfs_data_imported_at when the GTFS data has been imported\n# TYPE gtfs_data_imported_at gauge\ngtfs_data_imported_at ' || floor(EXTRACT(EPOCH FROM api.gtfs_data_imported_at())) || E'\n';
$$ LANGUAGE SQL IMMUTABLE;

GRANT EXECUTE ON FUNCTION api.gtfs_data_imported_at_metric TO postgrest;

0 comments on commit c2d7cb8

Please sign in to comment.