- Home
- Skills
- Akin Ozer
- Cc Devops Skills
- Logql Generator
logql-generator_skill
- HCL
83
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill akin-ozer/cc-devops-skills --skill logql-generator- SKILL.md14.5 KB
Overview
This skill is a comprehensive toolkit for generating production-ready LogQL queries that follow current standards and conventions. It guides you through an interactive planning workflow, produces optimized LogQL for logs or metrics, and provides repeatable patterns for dashboards, alerts, and troubleshooting. Use it to convert requirements into accurate, performant queries for Loki.
How this skill works
The skill engages you in collaborative planning: it asks about goals, log sources, formats, and whether you want log or metric queries. It then recommends stream selectors, line filters, parsers, and aggregations, presents a plain‑English plan for confirmation, and generates final LogQL along with usage notes. For complex or performance‑critical queries it references vetted examples and best practices before producing the query.
When to use it
- Creating LogQL for dashboards, panels, or observability panels
- Designing alerting rules or recording rules based on logs
- Troubleshooting application errors, performance, or security incidents
- Converting log parsing requirements (JSON, logfmt, patterns) into queries
- Building metrics from logs (error rates, latency percentiles, topk)
Best practices
- Always narrow stream selectors with specific labels before applying heavy parsing
- Apply cheap line filters (|=, |~) before parsers; parsing is more expensive
- Prefer pattern or logfmt over json when performance matters; avoid regex when possible
- Use aggregation functions (count_over_time, rate, quantile_over_time) with appropriate time ranges
- Present a plain‑English plan and confirm before generating final queries
Example use cases
- Alerting: error rate > 5% for a service using sum(rate(...)) and vector(0) fallback
- Dashboard: 95th percentile latency using quantile_over_time on an unwrapped duration field
- Ad‑hoc troubleshooting: incremental build—test stream selector, add line filter, then parser
- Top-N reporting: topk or approx_topk for high‑volume endpoints with sum by (endpoint)
- Structured metadata: filter detected_level or trace_id after confirming Loki 3.x features
FAQ
Yes. I offer an incremental mode that shows each stage: stream selector, line filter, parser, label filter, then aggregation so you can test and debug at each step.
When are reference examples consulted?
For complex aggregations, performance‑critical queries, alerting rules, template functions, or regex/pattern extraction I consult vetted examples and best practices before generating queries to avoid edge cases.