signoz-writing-clickhouse-queries
Write raw ClickHouse SQL for a SigNoz dashboard panel — timeseries, value, or table widgets that the builder UI cannot express (custom joins, window functions, regex extraction over log bodies, aggregations beyond builder syntax). Trigger when the user explicitly asks for a "ClickHouse query", a "raw SQL panel", a "custom SQL widget", or describes a SigNoz dashboard panel whose query needs SQL the builder cannot produce. Anchored to dashboard-panel SQL specifically. For ad-hoc data exploration that does not need to land in a panel, use `signoz-generating-queries` instead.
What this skill does
# Writing ClickHouse Queries for SigNoz Dashboards ## When to Use Use this skill when the user asks for SigNoz queries involving: - Logs: severity, body text, log volume, structured fields, containers, services, or environments. - Traces: spans, latency, duration, p95 or p99, HTTP operations, DB operations, or error spans. - Dashboard panels: timeseries charts, value widgets, and table breakdowns. If the user asks for a dashboard panel but does not mention ClickHouse, still use this skill. ## Signal Detection Identify whether the request is about logs or traces. - Logs: log lines, severity, body text, log volume, container logs, or structured log fields. - Traces: spans, latency, duration, p99, trace analysis, HTTP operations, DB operations, or error spans. If the request is ambiguous, ask the user to clarify. ## Reference Routing - Logs: read [`references/clickhouse-logs-reference.md`](./references/clickhouse-logs-reference.md) before writing any query. - Traces: read [`references/clickhouse-traces-reference.md`](./references/clickhouse-traces-reference.md) before writing any query. Each reference covers table schemas, optimization patterns, attribute access syntax, dashboard templates, query examples, and a validation checklist. ## Quick Reference - Timeseries panel: return rows of `(ts, value)` for a chart over time. - Value panel: return a single `value` for a stat or counter widget. - Table panel: return labelled columns for a grouped breakdown. ## Key Variables by Signal ### Logs - Timestamp type: `UInt64` in nanoseconds. - Time filter: `$start_timestamp_nano` and `$end_timestamp_nano`. - Bucket filter: `$start_timestamp` and `$end_timestamp`. - Display conversion: `fromUnixTimestamp64Nano(timestamp)`. - Main table: `signoz_logs.distributed_logs_v2`. - Resource table: `signoz_logs.distributed_logs_v2_resource`. ### Traces - Timestamp type: `DateTime64(9)`. - Time filter: `$start_datetime` and `$end_datetime`. - Bucket filter: `$start_timestamp` and `$end_timestamp`. - Display conversion: use the timestamp directly. - Main table: `signoz_traces.distributed_signoz_index_v3`. - Resource table: `signoz_traces.distributed_traces_v3_resource`. ## Top Anti-Patterns - Missing `ts_bucket_start BETWEEN $start_timestamp - 1800 AND $end_timestamp`. - Using plain `IN` instead of `GLOBAL IN` on the resource fingerprint subquery. - Adding a resource CTE when there is no resource attribute filter. - Logs query with `$start_datetime` or `$end_datetime`. - Traces query with `$start_timestamp_nano` or `$end_timestamp_nano`. - Traces query with `resources_string['service.name']` instead of `resource_string_service$$name`. ## Query Attribution Every generated query MUST end with a `SETTINGS` clause for monitoring: ```sql SELECT ... FROM ... WHERE ... SETTINGS log_comment = 'signoz-writing-clickhouse-queries skill | YYYY-MM-DD' ``` Replace `YYYY-MM-DD` with today's date (e.g., `2026-04-03`). If the query already has a `SETTINGS` clause, append `log_comment` to it with a comma. ## Workflow 1. Detect the signal: logs or traces. 2. Read the matching reference file before writing the query. 3. Pick the panel type: timeseries, value, or table. 4. Build the query using the required patterns from the reference. 5. Append the `SETTINGS log_comment` attribution clause. 6. Validate the result with the checklist in the reference.
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".