Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Exporter running ? Manual installation method #208

Open
keyoss opened this issue Nov 12, 2023 · 1 comment
Open

Keep Exporter running ? Manual installation method #208

keyoss opened this issue Nov 12, 2023 · 1 comment

Comments

@keyoss
Copy link

keyoss commented Nov 12, 2023

Sorry - since i have issues with Docker on my Debian12 - (whenever the docker container for speedtest-exporter is running it takes 10s and the network goes down (like no route to host and such)) i decided to go the "manual" installation way. Which works so far.

The only question left is:

Execute the exporter - python src/exporter.py

how to keep it running?
i also changed my Prometheus.yml
since as soon as i ctrl+c it will stop the script and i doubt its not python that will start the script every 1hr by the changes in the prometheus.yml

but i wonder how the exporter python script keeps up and running in the background and restarts !?

Yeah, basically a noob here. :)

Thanks for any tips!

@bruins0437
Copy link

bruins0437 commented Mar 19, 2024

Here is an example of how I keep the python script running as a service.
`sudo nano /etc/systemd/system/speedtest_exporter.service

[Unit]
Description=Speedtest-Exporter service
After=multi-user.target
[Service]
User=prometheus
Type=simple
Environment=PYTHONUNBUFFERED=1
WorkingDirectory=/etc/prometheus/speedtest-exporter
ExecStart=/usr/bin/python3 /etc/prometheus/speedtest-exporter/src/exporter.py
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants