rouyng / tncexporter Goto Github PK
View Code? Open in Web Editor NEWA prometheus exporter for packet radio TNC metrics.
License: MIT License
A prometheus exporter for packet radio TNC metrics.
License: MIT License
I'm having an issue running this with systemd. do you have an example you can share?
Hey! Thanks for this project, it's great to see some metrics, and I got it up and running pretty quickly. I also shared my systemd config in #6.
I've come across an issue where the automatic reconnect to the TNC after the connection has been lost is successful, but the metrics are never updated again. The only way for the metrics to be updated is if I kill the tncexporter process and restart it.
I'm connecting tncexporter to direwolf, and occasionally start/stop the direwolf process. From the logs below, you can see that metrics don't update after the connection to the TNC is re-established, but after restarting tncexporter, it is working again (since it doesn't use the reconnect logic).
I was just going to edit the python script to have it exit when the connection is lost, as I'm running this as a systemd service and it would just auto restart anyway, but wanted to make this known if you weren't aware.
pi@raspberrypi:~ $ journalctl -u tncexporter -f
-- Journal begins at Sat 2000-01-01 13:00:19 NZDT. --
Aug 01 17:00:35 raspberrypi env[502]: INFO: 01-Aug-23 17:00:35 - Attempting to connect to TNC at localhost:8000
Aug 01 17:00:35 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:35 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:00:45 raspberrypi env[502]: INFO: 01-Aug-23 17:00:45 - Attempting to connect to TNC at localhost:8000
Aug 01 17:00:45 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:45 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:00:55 raspberrypi env[502]: INFO: 01-Aug-23 17:00:55 - Attempting to connect to TNC at localhost:8000
Aug 01 17:00:55 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:55 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:05 raspberrypi env[502]: INFO: 01-Aug-23 17:01:05 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:05 raspberrypi env[502]: ERROR: 01-Aug-23 17:01:05 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Connection established to TNC at localhost:8000
pi@raspberrypi:~ $ service tncexporter restart
pi@raspberrypi:~ $ journalctl -u tncexporter -f
-- Journal begins at Sat 2000-01-01 13:00:19 NZDT. --
Aug 01 17:00:55 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:55 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:05 raspberrypi env[502]: INFO: 01-Aug-23 17:01:05 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:05 raspberrypi env[502]: ERROR: 01-Aug-23 17:01:05 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Connection established to TNC at localhost:8000
Aug 01 17:03:44 raspberrypi systemd[1]: Stopping TNC Exporter...
Aug 01 17:03:44 raspberrypi systemd[1]: tncexporter.service: Succeeded.
Aug 01 17:03:44 raspberrypi systemd[1]: Stopped TNC Exporter.
Aug 01 17:03:44 raspberrypi systemd[1]: tncexporter.service: Consumed 5min 44.813s CPU time.
Aug 01 17:03:44 raspberrypi systemd[1]: Started TNC Exporter.
Aug 01 17:03:45 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:45 - Attempting to connect to TNC at localhost:8000
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:45 - Connection established to TNC at localhost:8000
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:46 - Serving TNC prometheus metrics on: http://0.0.0.0:9110/metrics
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:46 - Updated metrics for 0 packets
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:48 - 10.1.0.103 [01/Aug/2023:05:03:48 +0000] "GET /metrics HTTP/1.1" 200 2543 "-" "Prometheus/2.44.0"
Aug 01 17:04:03 raspberrypi env[2642]: INFO: 01-Aug-23 17:04:03 - 10.1.0.103 [01/Aug/2023:05:04:03 +0000] "GET /metrics HTTP/1.1" 200 2543 "-" "Prometheus/2.44.0"
Aug 01 17:04:16 raspberrypi env[2642]: INFO: 01-Aug-23 17:04:16 - Updated metrics for 0 packets
Aug 01 17:04:18 raspberrypi env[2642]: INFO: 01-Aug-23 17:04:18 - 10.1.0.103 [01/Aug/2023:05:04:18 +0000] "GET /metrics HTTP/1.1" 200 2543 "-" "Prometheus/2.44.0"
Distance set as per instructions - distance as decimal 56.0552 -27093. Distances displayed are in billions of metres....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.