updated speed logger
This commit is contained in:
17
prometheus_test.py
Normal file
17
prometheus_test.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
|
||||
|
||||
# Config
|
||||
PUSHGATEWAY_URL = "https://pushgateway.cato447.de"
|
||||
JOB_NAME = "test_push"
|
||||
|
||||
# Create a new registry for the job
|
||||
registry = CollectorRegistry()
|
||||
test_metric = Gauge('test_metric_value', 'Just a test metric', registry=registry)
|
||||
|
||||
# Set the metric value (e.g., random or fixed)
|
||||
test_metric.set(42)
|
||||
|
||||
# Push to the gateway
|
||||
push_to_gateway(PUSHGATEWAY_URL, job=JOB_NAME, registry=registry)
|
||||
print("Pushed test metric to Pushgateway.")
|
||||
|
||||
Reference in New Issue
Block a user