diff --git a/Dockerfile b/Dockerfile index 4c222f3..0245c01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ COPY --from=builder /app/node_modules ./node_modules # add source code ADD . /app -# CLI some test +# CLI smoke test RUN ./cli.js --help >/dev/null ENTRYPOINT [ "./cli.js"] diff --git a/index.js b/index.js index b877e10..34e4788 100644 --- a/index.js +++ b/index.js @@ -76,6 +76,10 @@ const sendVdv453DataToNats = async (cfg, opt = {}) => { 'service', // VDV-453/-454 service, e.g. AUS ], }) + // todo: switch back to a regular Gauge but set the measurement timestamp manually, once that's possible again? + // see also https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#NewMetricWithTimestamp + // see also https://github.com/siimon/prom-client/issues/177 + // see also https://github.com/siimon/prom-client/issues/590 const vdvStatusAntwortOkTimestampSeconds = new Gauge({ name: 'vdv_statusantwort_ok_timestamp_seconds', help: 'when the VDV-453 server has last reported as (not) ok via StatusAntwort', diff --git a/package.json b/package.json index da39930..3db034d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vdv-453-nats-adapter", "description": "Sends realtime public transport data from a VDV-453/VDV-454 API to a NATS message broker.", - "version": "1.0.0", + "version": "1.1.0", "preferGlobal": true, "type": "module", "main": "index.js", diff --git a/readme.md b/readme.md index d56988d..f56be0f 100644 --- a/readme.md +++ b/readme.md @@ -85,6 +85,10 @@ Examples: ## Operating `vdv-453-nats-adapter` +### Logs + +`vdv-453-nats-adapter` writes [pino-formatted](https://getpino.io/) log messages to `stdout`, so you can use [pino-compatible tools](https://getpino.io/#/docs/ecosystem) to process them. + ### Monitoring `vdv-453-nats-adapter` exposes [Prometheus](https://prometheus.io)-compatible metrics via HTTP. By default, the metrics server will listen on a random port. You can configure a permanent port using `$METRICS_SERVER_PORT`. @@ -94,8 +98,6 @@ The following *kinds* of metrics will be exported: - the number of active subscriptions set up - the number of `AUS` `IstFahrt`s retrieved per fetch - the VDV API's `StartDienstZst` -- metrics related to NATS, e.g. - - the number of messages sent to NATS - [technical details about the Node.js process](https://github.com/siimon/prom-client/blob/c1d76c5d497ef803f6bd90c56c713c3fa811c3e0/README.md#default-metrics), e.g. the current state of garbage collection Refer to the [Grafana dashboard in VBB's deployment](https://github.com/OpenDataVBB/gtfs-rt-infrastructure/blob/cc920812506ae1b36962cd3453068ff199581392/lib/grafana/dashboards/gtfs-rt.json) for an example how to visualize `vdv-453-nats-adapter`'s metrics.