본문으로 건너뛰기
cccskills
무료GitHub에 공개

grafana

Use when working with Grafana — dashboards, Loki LogQL queries, alerting rules, monitoring panels — even when the user just says 'build me a dashboard' or 'query the logs' without naming Grafana.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Docker
설치 방법 보기

포함된 파일(1)

  • SKILL.md6.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Grafana Skill

When to use

Use this skill when:

  • Creating or editing Grafana dashboards (JSON provisioning)
  • Writing Loki LogQL queries for log analysis
  • Configuring alerting rules or contact points
  • Working on a Grafana module (if the project has one)
  • Debugging log-based issues using Loki data

Procedure: Create Grafana dashboard

  1. Inspect existing Grafana assets — Check the project's Grafana location (Docker config, dashboards/, provisioning) and existing datasources (Loki, Prometheus) before adding panels.
  2. Decide signals and layout — Pick the queries (LogQL / PromQL) and panel types per signal; reuse naming and label conventions below.
  3. Author the dashboard JSON — Add provisioned JSON under the dashboards path; wire datasources and template variables.
  4. Verify — Reload Grafana, confirm panels render against real data, and check alert rules fire on synthetic test inputs.

Project setup

Check if the project has a dedicated Grafana module or Docker config. Typical structure:

{grafana-location}/
├── .docker/
│   ├── grafana/
│   │   ├── dashboards/              ← Dashboard JSON files (provisioned)
│   │   ├── provisioning/
│   │   │   ├── datasources/         ← Loki, Prometheus data sources
│   │   │   └── dashboards/          ← Dashboard provisioning config
│   │   └── alerting/                ← Alert rules, contact points, notification policies
│   └── loki/
│       └── loki-config.yml          ← Loki server configuration
├── App/
│   ├── Logging/                     ← Loki timestamp processors
│   └── Console/Commands/            ← GrafanaPushDashboardsCommand
├── Docs/
│   └── Loki.md                      ← Loki documentation
└── Routes/console.php

Configuration

  • Grafana config: config/grafana.php
  • Logging channels: config/logging.php (Loki channels)
  • Loki package: itspire/monolog-loki via Monolog handler

Dashboard conventions

JSON provisioning

Dashboards are stored as JSON in .docker/grafana/dashboards/ and auto-provisioned. Use GrafanaPushDashboardsCommand to push dashboards to remote Grafana instances.

Panel rules

  • Always hide Loki metadata columns in table panels: labelTypes, traceID, traceID (field) → add to excludeByName in the organize transformation.
  • Verify column names match data semantics: If the timestamp represents imported_at, name the column "Imported", not "Uploaded".
  • Use consistent time ranges: Default to "Last 24 hours" for operational dashboards.
  • Add variables for customer FQDN, environment, and time range filters.

Naming

ElementConventionExample
Dashboard titleDescriptive, Title Case"Import Overview (Loki)"
Panel titleShort, descriptive"Import Results by Status"
Variable nameslowercase, underscore$fqdn, $environment

Loki LogQL

Query patterns

# Filter by service and status
{service="import_result"} |= "DONE" | json | status = "DONE"

# Count by label
sum by (status) (count_over_time({service="import_result"} | json [$__interval]))

# Filter by customer FQDN
{service="import_result", fqdn=~"$fqdn"} | json

Service labels

LabelPurposeNotes
import_resultFinal import states (DONE, FAILED)Use for result dashboards
import_snapshotCron-based status snapshotsUse for timeline dashboards
service=importLegacy static labelDo NOT query — use specific labels above

Best practices

  • Use json parser for structured log entries
  • Use line_format for human-readable output in explore view
  • Use $__interval for rate/count queries (auto-adjusts to time range)
  • Filter early in the pipeline (labels before line filters before parsers)

Alerting

Structure

.docker/grafana/alerting/
├── alert-rules.yml          ← Alert conditions and thresholds
├── contact-points.yml       ← Notification targets (Slack, email)
└── notification-policies.yml ← Routing rules (which alerts → which contacts)

Conventions

  • Alert names: descriptive, include severity: "Import Failure Rate > 10% (Critical)"
  • Use for duration to avoid flapping (e.g., for: 5m)
  • Group related alerts by folder/namespace

Integration with logging

The project uses structured logging via Monolog → Loki:

  • LokiTimestampProcessor — Adds precise timestamps to log entries
  • LokiTimestampChannelTap — Configures Loki channels with timestamp processing
  • Import events are logged via ImportEventLogger service

When adding new log entries for Grafana visualization:

  1. Use a dedicated log channel (defined in config/logging.php)
  2. Log as JSON with consistent field names
  3. Add appropriate Loki labels for filtering
  4. Update or create a dashboard panel for the new data

Related

  • Skill: logging-monitoring — full monitoring stack overview
  • Skill: dashboard-design — visualization selection, layout, KPI strategies
  • Skill: traefik — HTTPS for Grafana embedding in the app
  • Check the project for Grafana module or Docker config location
  • Config: config/grafana.php, config/logging.php (if applicable)

Output format

  1. Grafana dashboard JSON or LogQL/PromQL queries
  2. Panel configuration with data source and thresholds
  3. Alert rule definitions where applicable

Gotcha

  • Loki queries use LogQL, not PromQL — the syntax is different despite looking similar.
  • Don't create alerts without a clear notification channel — silent alerts are useless.
  • Dashboard panels that query too much data (>7 days at full resolution) will timeout — use downsampling.

Do NOT

  • Do NOT create panels without proper units and labels.
  • Do NOT use alerting rules without a notification channel.
  • Do NOT hardcode datasource names — use variables.

Auto-trigger keywords

  • Grafana
  • Loki
  • dashboard
  • log query
  • alerting
  • monitoring panel

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 20일 업데이트

Use when defining or auditing the activation event — aha-moment selection, retention correlation, falsifiable definition. Triggers on 'what is our aha moment', 'redefine activation'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 20일 업데이트

Use when capturing an architectural decision — file naming, next ADR number, Status / Context / Decision / Consequences, index regen; fires even without saying 'ADR'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 20일 업데이트

Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 20일 업데이트

Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 20일 업데이트

Use for an adversarial red-team / blue-team / auditor review of an AI agent's CONFIG + behaviour (rules, skills, MCP, hooks, permissions) — attack-chain → defensive-gap list, not a code audit.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config122026년 10월 20일 업데이트

event4u-app의 스킬 모두 보기

이 스킬의 문제 신고