Update dependencies, modify replica count, and implement metrics tracking - Updated sientia-dataops-library version from 1.3.5 to 1.3.7 in requirements.txt. - Changed replicaCount in values.yaml from 5 to 3 and incremented image tag from 0.2.7 to 0.3.1. - Added Prometheus metrics tracking in gates.py and worker.py, including a new write_metrics method. - Configured Prometheus service and ServiceMonitor in values.yaml for metrics collection.
28 lines
705 B
Python
28 lines
705 B
Python
from prometheus_client import Gauge, Counter
|
|
|
|
APP_UP = Gauge(
|
|
"app_up",
|
|
"Indicates if the application is running (1) or shutting down (0)",
|
|
["pod_id"],
|
|
)
|
|
|
|
CORE_LABELS = ["pod_id", "model_name", "pipeline_name"]
|
|
|
|
PREDICTIONS_WRITTEN_COUNT = Counter(
|
|
"laborious_predictions_written_count",
|
|
"Number of predictions written to the database table predictions",
|
|
CORE_LABELS,
|
|
)
|
|
|
|
PREDICTION_CONFIDENCE_MONITOR = Gauge(
|
|
"laborious_prediction_confidence_monitor",
|
|
"Current confidence of each prediction",
|
|
CORE_LABELS,
|
|
)
|
|
|
|
PREDICTION_RESPONSE_TIME_MONITOR = Gauge(
|
|
"laborious_prediction_response_time_monitor",
|
|
"Current response time of each prediction",
|
|
CORE_LABELS,
|
|
)
|