Skip to content

Commit

Permalink
readme: minor fixes 📝; minor tweaks; 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Nov 28, 2024
1 parent d496f8d commit 76d7b8c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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.
Expand Down

0 comments on commit 76d7b8c

Please sign in to comment.