authoring-traceql-and-metrics-queries

authoring-traceql-and-metrics-queries is a skill for Claude Code, Codex from talkops-ai/talkops-mcp. It costs 202 tokens per session (1,217 once invoked), scanned A, original, Apache-2.0.

A guide for writing and checking TraceQL and TraceQL Metrics queries for Grafana Tempo. TraceQL is a query language for finding distributed traces and spans, which are timed steps in a request across services.

In plain words
What is it for?
Use it to search traces by service or attributes, express parent-child and event relationships, calculate rates and latency distributions, and build trace waterfall views.
Why use it?
It prevents queries from relying on attribute names or values that the tracing system does not actually contain. It also helps account for changes in OpenTelemetry naming conventions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to search traces by service or attributes, express parent-child and event relationships, calculate rates and latency distributions, and build trace waterfall views.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add talkops-ai/talkops-mcp --skill authoring-traceql-and-metrics-queries
Clone the repo
git clone --depth 1 https://github.com/talkops-ai/talkops-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for authoring-traceql-and-metrics-queries

README.md
[![agentmods](https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries/github.svg)](https://agentmods.dev/skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries)
Your own site
<a href="https://agentmods.dev/skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries"><img src="https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for authoring-traceql-and-metrics-queries

Your own site · 80×15
<a href="https://agentmods.dev/skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries"><img src="https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/authoring-traceql-and-metrics-queries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 202 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00202 $0.01217
Opus 5.5 $0.00081 $0.00487
Sonnet 5.5 $0.00040 $0.00243
Haiku 4.5 $0.00020 $0.00122

Measured 11d ago against content hash b86a6adcac14, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

authoring-traceql-and-metrics-queries scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/lint_traceql.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/tempo-mcp-server/skills/authoring-traceql-and-metrics-queries/SKILL.md · 33 lines

How it starts

The opening of the file, as written. The whole thing — 33 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authoring TraceQL and Metrics Queries

Preconditions

  • Read tempo://server/capabilities, tempo://deployment/overview, and tempo://schema/{backend_id}/attributes (or call tempo_get_attribute_names) via MCP resources/tools before authoring any TraceQL expression.
  • Verify attribute values with tempo_get_attribute_values before hardcoding string literals in selectors.

Query Authoring Workflow Checklist

  • Step 1 — Discover Scoped Attributes: Read tempo://schema/default/attributes (or tempo://schema/<backend_id>/attributes via read_resource) first for instant SemConv and K8s attribute presence, then call tempo_get_attribute_names across scope="resource", scope="span", scope="event", scope="link", or scope="instrumentation" as needed.
  • Step 2 — Check OTel Semconv Dual-Schema: Consult otel-semconv-and-k8s-attributes.md to verify whether the deployment emits OTel v1.20 (http.status_code, net.peer.name, db.system) or OTel v1.24+ (http.response.status_code, server.address, db.system.name) attributes.
  • Step 3 — Compose TraceQL Selector & Structural Pipeline: Consult traceql-syntax.md and query-pack.md to construct span-set filters, structural operators (>, >>, ~, !>, !>>), select(), by(), coalesce(), and with(most_recent=true) hints. Whenever a target namespace is specified, include an explicit namespace resource predicate (resource.service.namespace = "<ns>" or resource.k8s.namespace.name = "<ns>") in the TraceQL selector in addition to passing tenant on multi-tenant backends.
  • Step 4 — Add TraceQL Metrics Aggregations (When Needed): Verify local-blocks is active in tempo://server/capabilities or tempo_get_diagnostics, then follow traceql-metrics.md when computing rate(), count_over_time(), quantile_over_time(), histogram_over_time(), sum_over_time(), avg_over_time(), min_over_time(), max_over_time(), topk(), or compare(). If local-blocks is disabled (METRICS_GENERATOR_PROCESSOR_ABSENT), fall back cleanly to bounded tempo_traceql_search sampling and show how to enable local-blocks.
  • Step 5 — Lint Query Before Execution: [GATE] Run scripts/lint_traceql.py --query '<traceql>' to validate balanced braces, unquoted status/kind intrinsic enums, explicit resource./span. attribute scopes, and bounded regex usage before invoking tempo_traceql_search, tempo_traceql_metrics_range, tempo_traceql_metrics_instant, or tempo_query_a2ui.
  • Step 6 — Execute, Visualize & Paginate:
    • For trace search: call tempo_traceql_search with most_recent=True for interactive triage; when truncated == True or len(traces) == limit, paginate deterministically by passing the returned next_window ("<start>..<end>" epoch range in since) rather than raising limit/spss unboundedly.
    • For time-series metrics: call tempo_traceql_metrics_range.
    • For instant top-K or cohort comparisons: call tempo_traceql_metrics_instant or tempo_compare_span_cohorts.
    • For interactive waterfall / flamegraph views of a specific trace_id: call tempo_query_a2ui instead of dumping raw span JSON.

Read the full file on GitHub · 33 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 33 lines · 202 tokens per session scan A b86a6adcac14

Subscribe to this mod's changes

authoring-traceql-and-metrics-queries is a skill published in the GitHub repository talkops-ai/talkops-mcp (4 stars, last pushed 12d ago), licensed Apache-2.0. It adds 202 tokens to every session and 1,217 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-18.

Related

authoring-traceql-and-metrics-queries compared with skills from other repositories

authoring-traceql-and-metrics-queries next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
authoring-traceql-and-metrics-queriestalkops-ai/talkops-mcpSkill412d agoApache-2.0A202Claude Code, Codex
chrome-devtools-cliChromeDevTools/chrome-devtools-mcpSkill60ktodayApache-2.0A31Claude Code
n8n-validation-expertczlonkowski/n8n-mcpSkill23k3d agoMITA91Claude Code, Codex
n8n-error-handlingczlonkowski/n8n-mcpSkill23k3d agoMITA128Claude Code, Codex
agentcore-investigationawslabs/mcpSkill10.0k2d agoApache-2.0A52Claude Code, Codex
openlore-analyze-codebaseclay-good/OpenLoreSkill369todayMITA48Claude Code, Codex
flutter-mcp-toolkit-intentcall-migrationArenukvern/mcp_flutterSkill4013d agoMITA58Claude Code