Add observability module: Spring AI built-in meters and spans, cost per endpoint from token usage, Prometheus and Grafana dashboard

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JXVi2GMQ7bR5EmbUFdDj7N
This commit is contained in:
Claude
2026-10-09 06:39:21 +00:00
parent 65f580c5bc
commit cc2a1b8bcb
45 changed files with 1731 additions and 0 deletions
@@ -0,0 +1,24 @@
# Span tree for GET /weather?city=Pune (one tool call, two model calls)
http get /weather [SERVER]
spring_ai chat_client [INTERNAL]
tool _calling [INTERNAL]
call [INTERNAL]
chat gpt-4o-mini [INTERNAL]
POST [CLIENT]
execute_tool getWeather [INTERNAL]
call [INTERNAL]
chat gpt-4o-mini [INTERNAL]
POST [CLIENT]
attribute keys on the model-call spans:
gen_ai.operation.name
gen_ai.request.model
gen_ai.response.finish_reasons
gen_ai.response.id
gen_ai.response.model
gen_ai.system
gen_ai.usage.input_tokens
gen_ai.usage.output_tokens
gen_ai.usage.total_tokens
spring.ai.model.request.tool.names