mirror of
https://github.com/recklessop/Zerto_Exporter.git
synced 2026-07-05 08:43:14 -04:00
threads logger update
updated threads file so that it shows which exporter it is actually monitoring incase there is many
This commit is contained in:
@@ -8,3 +8,4 @@ app/threads
|
|||||||
app/threads.txt
|
app/threads.txt
|
||||||
app/vrametrics
|
app/vrametrics
|
||||||
app/vrametrics.txt
|
app/vrametrics.txt
|
||||||
|
app/logs/Log-Main-Justins-MBP.askey.com.log
|
||||||
|
|||||||
@@ -591,33 +591,34 @@ def GetVraMetrics():
|
|||||||
|
|
||||||
# function which monitors the threads and restarts them if they die
|
# function which monitors the threads and restarts them if they die
|
||||||
def ThreadProbe():
|
def ThreadProbe():
|
||||||
|
global container_id
|
||||||
while True:
|
while True:
|
||||||
log.debug("Thread Probe Started")
|
log.debug("Thread Probe Started")
|
||||||
metricsDictionary = {}
|
metricsDictionary = {}
|
||||||
|
|
||||||
log.debug("Is Auth Thread Alive")
|
log.debug("Is Auth Thread Alive")
|
||||||
if auth_thread.is_alive():
|
if auth_thread.is_alive():
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "AuthHandler" + "\"}"] = 1
|
metricsDictionary["exporter_thread_status{thread=\"" + "AuthHandler" + "\",ExporterInstance=\"" + container_id + "\"}"] = 1
|
||||||
else:
|
else:
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "AuthHandler" + "\"}"] = 0
|
metricsDictionary["exporter_thread_status{thread=\"" + "AuthHandler" + "\",ExporterInstance=\"" + container_id + "\"}"] = 0
|
||||||
|
|
||||||
log.debug("Is Data Thread Alive")
|
log.debug("Is Data Thread Alive")
|
||||||
if data_thread.is_alive():
|
if data_thread.is_alive():
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "DataStats" + "\"}"] = 1
|
metricsDictionary["exporter_thread_status{thread=\"" + "DataStats" + "\",ExporterInstance=\"" + container_id + "\"}"] = 1
|
||||||
else:
|
else:
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "DataStats" + "\"}"] = 0
|
metricsDictionary["exporter_thread_status{thread=\"" + "DataStats" + "\",ExporterInstance=\"" + container_id + "\"}"] = 0
|
||||||
|
|
||||||
log.debug("Is Stats Thread Alive")
|
log.debug("Is Stats Thread Alive")
|
||||||
if stats_thread.is_alive():
|
if stats_thread.is_alive():
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "EncryptionStats" + "\"}"] = 1
|
metricsDictionary["exporter_thread_status{thread=\"" + "EncryptionStats" + "\",ExporterInstance=\"" + container_id + "\"}"] = 1
|
||||||
else:
|
else:
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "EncryptionStats" + "\"}"] = 0
|
metricsDictionary["exporter_thread_status{thread=\"" + "EncryptionStats" + "\",ExporterInstance=\"" + container_id + "\"}"] = 0
|
||||||
|
|
||||||
log.debug("Is VRA Metrics Thread Alive")
|
log.debug("Is VRA Metrics Thread Alive")
|
||||||
if vra_metrics_thread.is_alive():
|
if vra_metrics_thread.is_alive():
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "VraMetrics" + "\"}"] = 1
|
metricsDictionary["exporter_thread_status{thread=\"" + "VraMetrics" + "\",ExporterInstance=\"" + container_id + "\"}"] = 1
|
||||||
else:
|
else:
|
||||||
metricsDictionary["exporter_thread_status{thread=\"" + "VraMetrics" + "\"}"] = 0
|
metricsDictionary["exporter_thread_status{thread=\"" + "VraMetrics" + "\",ExporterInstance=\"" + container_id + "\"}"] = 0
|
||||||
|
|
||||||
log.debug("Writing Probe data to files")
|
log.debug("Writing Probe data to files")
|
||||||
file_object = open('threads', 'w')
|
file_object = open('threads', 'w')
|
||||||
@@ -665,6 +666,7 @@ data_thread = start_thread(GetDataFunc)
|
|||||||
stats_thread = start_thread(GetStatsFunc)
|
stats_thread = start_thread(GetStatsFunc)
|
||||||
vra_metrics_thread = start_thread(GetVraMetrics)
|
vra_metrics_thread = start_thread(GetVraMetrics)
|
||||||
webserver_thread = start_thread(WebServer)
|
webserver_thread = start_thread(WebServer)
|
||||||
|
probe_thread = start_thread(ThreadProbe)
|
||||||
|
|
||||||
# loop indefinitely
|
# loop indefinitely
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user