Claude Code supports using OpenTelemetry to gather some metrics including token usage, cost, user prompts and tool calls (unfortunately no system prompts).
This is possible without custom certificates, MITM or proxies. However you do need something to collect, store and visualise the OTEL data.
I use Grafana Alloy (running in Docker) and Grafana Cloud for this but you could use any OTEL provider including SigNoz.
Leave it running, track your usage and when you hit limits look back to understand how many tokens that actually was.
laplaque•11m ago
Nice — Prometheus/Grafana is the right call for token spend visibility. The harder part I've found is seeing what's actually in the traffic, not just how much. I ended up building an open-source MITM proxy for that — Prometheus metrics endpoint is on the roadmap but not there yet.
kisamoto•1h ago
This is possible without custom certificates, MITM or proxies. However you do need something to collect, store and visualise the OTEL data.
I use Grafana Alloy (running in Docker) and Grafana Cloud for this but you could use any OTEL provider including SigNoz.
Leave it running, track your usage and when you hit limits look back to understand how many tokens that actually was.