Repository navigation
Query telemetry and manage dashboards from the MCP server and management API - #347
Merged
Merged
Conversation
Adds read-only telemetry operations to the shared management operations, so each one is an MCP tool and a REST endpoint: - query_logs: search logs by service, level, body text, trace, and resource or log attributes - query_traces: search spans by service, name, status, duration, and resource or span attributes - get_trace: one trace's spans and logs - query_metrics: recent metric points across all metric kinds - list_services: services that sent telemetry in a window Each needs the telemetry capability and a telemetry store, and reads only the caller's workspace. Windows default to the last hour and are at most 30 days. A ClickHouse timeout returns telemetry_query_timeout with advice to narrow the query.
Contributor
Author
|
Hosted gitlink bump: superloglabs/responder#498 |
Adds dashboard operations over the existing dashboard store: list_dashboards, get_dashboard, create_dashboard, update_dashboard, delete_dashboard, add_dashboard_widget, update_dashboard_widget, update_dashboard_layout, and delete_dashboard_widget. They need the telemetry and dashboards capabilities and a telemetry store, like the Dashboards page. Widget configs are checked against the widget type as the editor checks them, and responses link to the dashboard in Superlog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Superlog MCP server covered automations, runs, tag mode, models, and secrets. It could not read telemetry or touch dashboards. The old Superlog MCP had telemetry and dashboard tools, and people used them. This brings them back on the current server.
Every new operation is an MCP tool and a REST endpoint under
/api/v1.Telemetry (
telemetry-operations.ts)query_logsPOST /telemetry/logs/searchquery_tracesPOST /telemetry/traces/searchget_traceGET /telemetry/traces/{traceId}query_metricsPOST /telemetry/metrics/searchlist_servicesGET /telemetry/servicespackages/core/src/telemetry/query.ts, which scope every read to the caller's workspace.telemetrycapability and a telemetry store. Otherwise it returns 404telemetry_unavailable.range(15mto7d, default1h) orsince/until, at most 30 days.exception, timestamps are UTC ISO, ClickHouse 64-bit integers become numbers, and the internalsuperlog.project_idtag is removed.telemetry_query_timeoutwith advice to narrow the query.Dashboards (
dashboard-operations.ts)list_dashboardsGET /dashboardsget_dashboardGET /dashboards/{dashboardId}create_dashboardPOST /dashboardsupdate_dashboardPATCH /dashboards/{dashboardId}delete_dashboardDELETE /dashboards/{dashboardId}add_dashboard_widgetPOST /dashboards/{dashboardId}/widgetsupdate_dashboard_widgetPATCH /dashboards/{dashboardId}/widgets/{widgetId}update_dashboard_layoutPATCH /dashboards/{dashboardId}/layoutdelete_dashboard_widgetDELETE /dashboards/{dashboardId}/widgets/{widgetId}db/telemetry-dashboards.ts) and schemas (telemetry/dashboards.ts) as the Dashboards page, so the page shows MCP-made dashboards unchanged.telemetryanddashboardscapabilities and a telemetry store.widgetConfigProblemfor the widget's type, for example a metric chart without a metric. The page's own widget PATCH route skips this check.url.Other changes
The MCP server instructions, the OpenAPI document, the README, and the copy on the API keys, MCP, and OAuth consent pages mention telemetry and dashboards.
Testing
pnpm typecheck,pnpm lint,pnpm testpass.telemetry-operations.test.tsanddashboard-operations.test.tscover annotations, input mapping, row shaping, config checks, missing capabilities or store, not-found cases, timeouts, and window validation.26.8.21.10built frominfra/telemetry/clickhouse-schema.sql, seeded with data for two workspaces. All tools returned the expected rows, and the other workspace's data did not appear.dashboard_not_foundfor get, delete, and add widget, and listed no dashboards.