jo-m / trainbot

Watches a piece of train track, detects trains, and stitches together images of them.
https://trains.jo-m.ch/
MIT License
465 stars 8 forks source link

Prometheus exporter endpoint #23

Closed clonejo closed 8 months ago

clonejo commented 9 months ago

The Grafana dashboard diffs are a bit of a pain to clean up, so some fixups and changes are relegated to the last commit.

I hope the downgrade of the Go version in go.sum to 1.20 is OK, that is what Fedora ships. The version in the Makefile is unchanged, ofc.

Fixes #21.

clonejo commented 9 months ago

I am a bit sceptical about the global state/variables, but I guess this seems to be the way to do it according to the prometheus guide, and it also kind of makes sense

An alternative could be to intersperse the prometheus variables/functions more with the files they instrument.

CI/linting does not pass with your changes, you should be able to reproduce that locally via make docker_lint

Whoops. Fixed.

I'd move the Grafana JSON file somewhere else, e.g. top level into a new grafana/ directory.

done

Also, a short paragraph in the readme about the Prometheus endpoint and dashboard JSON would be nice. 2 lines are enough, just to make it discoverable.

done

jo-m commented 8 months ago

Thanks! Shall I merge it as is?

clonejo commented 8 months ago

Thanks! Shall I merge it as is?

go ahead!

Typically i mark as draft if it's not ready for merge.