[PR #351] [MERGED] fix(observability): correct Claude Code dashboard queries against live telemetry #96
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
webgrip/homelab-cluster#96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/webgrip/homelab-cluster/pull/351
Author: @Ryangr0
Created: 6/7/2026
Status: ✅ Merged
Merged: 6/7/2026
Merged by: @Ryangr0
Base:
main← Head:fix/claude-code-dashboard-queries📝 Commits (1)
90750e9fix(observability): correct Claude Code dashboard queries against live telemetry📊 Changes
4 files changed (+19 additions, -19 deletions)
View changed files
📝
kubernetes/apps/observability/grafana/app/dashboards/claude-code-activity-tools.yaml(+8 -8)📝
kubernetes/apps/observability/grafana/app/dashboards/claude-code-command-center.yaml(+5 -5)📝
kubernetes/apps/observability/grafana/app/dashboards/claude-code-cost-tokens.yaml(+4 -4)📝
kubernetes/apps/observability/grafana/app/dashboards/claude-code-events-traces.yaml(+2 -2)📄 Description
Follow-up to #350. Now that Claude Code telemetry is actually flowing (
service.name=claude-code), I verified every query class against live data and fixed two issues the documented schema didn't surface.Fixes
active_timemetric name — it isclaude_code_active_time_seconds_total(not the guessed_active_time_total_seconds_total); dropped the dead fallback. Affects 4 panels across all dashboards. (cost_usage_USD_total/token_usage_tokens_total/session_count_totalwere already exact.)attributes.*— a bare| jsonexplodes every attribute into a stream label, which silently brokequantile_over_time/unwrap(returned per-line raw values instead of an aggregate). Switched all aggregation queries to explicit extraction, e.g.| json duration_ms="attributes.duration_ms" | unwrap duration_ms. Logs panels keep bare| json(display only).full_command, and editedfile_pathlive insideattributes.tool_parameters/attributes.tool_input; extracted vialine_format "{{.x}}" | json field="field"re-parse.Verified live (via Grafana MCP)
quantile_over_timeonattributes_duration_msreturns a single clean p90.Notes
active_time/lines_of_code/commit/pull_request/code_edit_tool.decisionpopulate as those events occur (none yet in the initial SDK session — not a query bug).custom(Claude Code redacts user-configured MCP server names by default).Validation: inline dashboard JSON parses, unique panel IDs,
$$-escaped macros intact;kustomize build kubernetes/apps/observability/grafana/appis clean (35 dashboards / 10 folders).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.