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.
As someone on Reddit pointed out, now that it's in the Grafana stack you can also use standard alert management & notification tools to send updates on usage and alerts for abnormal spikes.
Comments
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.
As someone on Reddit pointed out, now that it's in the Grafana stack you can also use standard alert management & notification tools to send updates on usage and alerts for abnormal spikes.