Fix label issue in metrics (#540)

This commit is contained in:
cybermaggedon 2025-09-26 14:13:22 +01:00 committed by GitHub
parent 10806caac2
commit d1456e547c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,7 +32,7 @@ class LlmService(FlowProcessor):
def __init__(self, **params): def __init__(self, **params):
id = params.get("id") id = params.get("id", default_ident)
concurrency = params.get("concurrency", 1) concurrency = params.get("concurrency", 1)
super(LlmService, self).__init__(**params | { super(LlmService, self).__init__(**params | {
@ -111,11 +111,12 @@ class LlmService(FlowProcessor):
request.system, request.prompt, model, temperature request.system, request.prompt, model, temperature
) )
await __class__.text_completion_model_metric.labels( __class__.text_completion_model_metric.labels(
processor = self.id, flow = flow.name processor = self.id,
flow = flow.name
).info({ ).info({
"model": model, "model": str(model) if model is not None else "",
"temperature": temperature, "temperature": str(temperature) if temperature is not None else "",
}) })
await flow("response").send( await flow("response").send(