Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Lincoln Bryant committed Mar 29, 2024
2 parents 03141b9 + 06818fd commit cd20fa2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prometheus/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from subprocess import check_call
from prometheus_client import start_http_server, Gauge, Enum
import requests
import threading
import sys


class AppMetrics:
Expand Down Expand Up @@ -37,6 +39,10 @@ def run_metrics_loop(self):
"""Metrics fetching loop"""

while True:
if threading.active_count() != 2:
print(f"Unexpected threadcount: {threading.active_count()}, so exit the program")
sys.exit(1)

self.fetch()
time.sleep(self.polling_interval_seconds)

Expand Down

0 comments on commit cd20fa2

Please sign in to comment.