@@ -184,6 +184,22 @@ def on_llm_end(
184184 semconv .SemanticConvention .PRICE_UNIT : 0.1 ,
185185 semconv .SemanticConvention .INPUT_PRICE : 34.5 ,
186186 semconv .SemanticConvention .CURRENCY : "USD" ,
187+
188+ "gen_ai.metrics.latency.first_token" : self .latency_first_resp ,
189+ "gen_ai.metrics.latency.model_total" : round (latency , 1 ),
190+ "gen_ai.metrics.latency.span" : round (latency , 1 ),
191+ "gen_ai.metrics.request.model_request_count" : 1 ,
192+ "gen_ai.metrics.usage.currency" : "USD" ,
193+ "gen_ai.metrics.usage.input_cost" : 6.576 ,
194+ "gen_ai.metrics.usage.input_tokens" : 822 ,
195+ "gen_ai.metrics.usage.output_cost" : 2.48 ,
196+ "gen_ai.metrics.usage.output_token_tps" : 27.80269058295964 ,
197+ "gen_ai.metrics.latency.agent_total" : round (latency , 1 ),
198+ "gen_ai.metrics.usage.output_tokens" : 124 ,
199+ "gen_ai.metrics.usage.total_cost" : 6.2 ,
200+ "gen_ai.metrics.usage.total_tokens" : 946 ,
201+ "gen_ai.span_type" : "core_llm" ,
202+ "gen_ai.metrics.request.agent_request_count" : 1 ,
187203 }
188204 )
189205 span .set_status (status = StatusCode .OK , description = "" )
0 commit comments