prometheus exporter for gpsd
Go to file
Harald Welte fb56ba166c update go.mod s/gps2prom/gpsd2prometheus/ 2023-01-01 15:33:55 +01:00
grafana-dashboard add screenshot of sample grafana dashboard 2023-01-01 15:22:53 +01:00
COPYING add license; expand README 2023-01-01 15:09:07 +01:00
README.md add screenshot of sample grafana dashboard 2023-01-01 15:22:53 +01:00
go.mod update go.mod s/gps2prom/gpsd2prometheus/ 2023-01-01 15:33:55 +01:00
gpsd2prometheus.go add license; expand README 2023-01-01 15:09:07 +01:00

README.md

gspd2prometheus - a prometheus exporter for gpsd

This is a small project in the go programming language, connecting to a gpsd (using its JSON-over-TCP protocol) and exposing various stats in prometheus exporter syntax over HTTP for prometheus to collect/scrape them.

It's my very first go project, and I had the basics put together in about 15mins, spending another 90mins adding more gauges. Your mileage may vary!

Usage

Usage of gpsd2prometheus:
  -gpsd string
        remote gpsd host:port (default "localhost:2947")
  -http string
        local HTTP listen host:port (default ":2112")

So you simply run the gpsd2prometheus somewhere and

  • point it to the TCP host/port of the gpsd socket
  • tell it on which HTTP port to listen for prometheus to scrape
  • configure prometheus to actually scrape with a section as stated below
scrape_configs:
  - job_name: gpsd
    static_configs:
      - targets: ['hostname:2112']

Grafana

There's a sample grafana dashboard

sample grafana dashboard

Credits

All the real workhorse code behind this project is in the following two upstream libraries I'm using:

This project is just gluing together the above two libraries.

License

I'm usually much more in favor of copyleft licenses, but given the two libraries I use are MIT and Apache 2.0, I decided to go for a permissive license in this project, too. So the code is released under Apache 2.0, see the COPYING file for details.