SIENTIAPDE-1169
Update OPC metrics to include opc_server_id for enhanced tracking
This commit is contained in:
@@ -30,12 +30,12 @@ PREDICTION_RESPONSE_TIME_MONITOR = Histogram(
|
||||
PREDICTION_OPC_WRITING_COUNT = Counter(
|
||||
"laborious_prediction_opc_writing_count",
|
||||
"Number of predictions written to the OPC server",
|
||||
CORE_LABELS,
|
||||
[CORE_LABELS, "opc_server_id"],
|
||||
)
|
||||
|
||||
PREDICTION_OPC_WRITING_RESPONSE_TIME_MONITOR = Histogram(
|
||||
"laborious_prediction_opc_writing_response_time_monitor",
|
||||
"Current response time of each prediction written to the OPC server",
|
||||
CORE_LABELS,
|
||||
[CORE_LABELS, "opc_server_id"],
|
||||
buckets=[0.01, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0]
|
||||
)
|
||||
|
||||
@@ -266,7 +266,8 @@ class OpcRepository():
|
||||
metrics.PREDICTION_OPC_WRITING_COUNT.labels(
|
||||
pod_id=self.pod_id,
|
||||
model_name=metadata['model_name'],
|
||||
pipeline_name=metadata['workflow_name']
|
||||
pipeline_name=metadata['workflow_name'],
|
||||
opc_server_id=self.id
|
||||
).inc()
|
||||
|
||||
end_time = time.time()
|
||||
@@ -274,7 +275,8 @@ class OpcRepository():
|
||||
metrics.PREDICTION_OPC_WRITING_RESPONSE_TIME_MONITOR.labels(
|
||||
pod_id=self.pod_id,
|
||||
model_name=metadata['model_name'],
|
||||
pipeline_name=metadata['workflow_name']
|
||||
pipeline_name=metadata['workflow_name'],
|
||||
opc_server_id=self.id
|
||||
).observe(response_time)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user