@@ -235,6 +235,7 @@ def run(
235235 logger .info ("Dialog %s already transcribed on vCon: %s" , index , vCon .uuid )
236236 continue
237237
238+ attrs = {"link.name" : link_name , "vcon.uuid" : vcon_uuid }
238239 start = time .time ()
239240 try :
240241 if opts .get ("LITELLM_PROXY_URL" ) and opts .get ("LITELLM_MASTER_KEY" ):
@@ -248,26 +249,26 @@ def run(
248249 result = transcribe_dg (dg_client , dialog , opts ["api" ], vcon_uuid = vcon_uuid , run_opts = opts )
249250 except Exception as e :
250251 logger .error ("Failed to transcribe vCon %s after multiple retries: %s" , vcon_uuid , e , exc_info = True )
251- increment_counter ("conserver.link.deepgram.transcription_failures" )
252+ increment_counter ("conserver.link.deepgram.transcription_failures" , attributes = attrs )
252253 raise e
253254 elapsed = time .time () - start
254- record_histogram ("conserver.link.deepgram.transcription_time" , elapsed )
255+ record_histogram ("conserver.link.deepgram.transcription_time" , elapsed , attributes = attrs )
255256 logger .info (f"Transcription for dialog { index } took { elapsed :.2f} seconds." )
256257
257258 if not result :
258259 logger .warning ("No transcription generated for vCon %s, dialog %s" , vcon_uuid , index )
259- increment_counter ("conserver.link.deepgram.transcription_failures" )
260+ increment_counter ("conserver.link.deepgram.transcription_failures" , attributes = attrs )
260261 break
261262
262263 # Log and track confidence (not available for LiteLLM/OpenAI-format transcription)
263264 confidence = result .get ("confidence" )
264265 if confidence is not None :
265- record_histogram ("conserver.link.deepgram.confidence" , confidence )
266+ record_histogram ("conserver.link.deepgram.confidence" , confidence , attributes = attrs )
266267 logger .info (f"Transcription confidence for dialog { index } : { confidence } " )
267268 # If the confidence is too low, don't store the transcript
268269 if confidence < opts ["minimum_confidence" ]:
269270 logger .warning ("Low confidence result for vCon %s, dialog %s: %s" , vcon_uuid , index , confidence )
270- increment_counter ("conserver.link.deepgram.transcription_failures" )
271+ increment_counter ("conserver.link.deepgram.transcription_failures" , attributes = attrs )
271272 continue
272273 else :
273274 logger .info (f"Confidence not available for dialog { index } (LiteLLM path), skipping threshold check" )
0 commit comments