Generated banner for Grafana Oss
Generated logo for Grafana Oss

Grafana Oss

Grafana LabsOfficialPublished by Grafana Labs

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Medium risk

From the author

Configure Grafana OSS — provisions dashboards from YAML, sets up data sources (Prometheus / Loki / Tempo / Pyroscope), writes dashboard JSON with template variables, builds panel queries, assigns built-in roles (Viewer / Editor / Admin / GrafanaAdmin), mints service-account tokens, edits grafana.ini server config, creates annotations, installs plugins via provisioning, and validates each step with a health-check curl. Use when building dashboards, configuring data sources, setting up provisioning YAML, picking a panel type, writing template variables, managing users and roles, configuring SMTP/OAuth in grafana.ini, creating annotations via API, troubleshooting why a provisioned dashboard isn't showing up, or running Grafana OSS locally — even when the user says "set up a Prometheus data source", "provision dashboards from git", "make a service account", or "configure SSO in OSS" without saying "Grafana OSS".
— the description by Grafana Labs

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides comprehensive guidance for managing Grafana OSS instances. It covers the full lifecycle of configuration, from setting up data sources like Prometheus, Loki, and Tempo to automating dashboard provisioning via YAML files. It also details user and service account management, RBAC role assignments, plugin installation, and server-level configuration via grafana.ini. The skill emphasizes validation through health-check API calls to ensure that provisioned resources are correctly integrated and operational.

What it does

  • Provisions dashboards and data sources using YAML configuration files.
  • Manages service accounts and mints authentication tokens for API access.
  • Configures server settings, including SMTP and OAuth, via grafana.ini.
  • Assigns built-in roles such as Viewer, Editor, Admin, and GrafanaAdmin.
  • Installs and configures plugins through provisioning workflows.
  • Validates configuration success using API-based health checks.

When to use it

  • When setting up a new Grafana OSS instance or automating environment configuration.
  • When you need to provision dashboards or data sources as code.
  • When managing user access, roles, or service account tokens.
  • When troubleshooting why a provisioned dashboard or data source is not appearing.
  • When configuring server-level settings like authentication or SMTP.

Advantages

  • Enables infrastructure-as-code practices for Grafana configuration.
  • Provides clear, repeatable steps for common administrative tasks.
  • Includes built-in verification steps to confirm configuration success.
  • Centralizes documentation for API interactions and YAML schemas.

Usage examples

“How do I set up a Prometheus data source using a YAML file?”
The agent provides the specific YAML structure for a Prometheus data source, including the required fields like name, type, and URL, and explains how to verify it via the health-check API.
“Create a service account for CI/CD with read-only access.”
The agent provides the YAML configuration for the service account with the 'Viewer' role and the subsequent API commands to mint a token for that account.
“My provisioned dashboard isn't showing up in Grafana. How do I debug it?”
The agent guides you through checking the provisioning logs, verifying the file path, and using the API to confirm if the dashboard UID exists in the system.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/grafana/grafana-oss/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip grafana-oss.zip -d .agents/skills

Documentation by Grafana Labs

Grafana OSS

Docs: https://grafana.com/docs/grafana/latest.md

Common Workflows

Provisioning dashboards from disk
  1. Drop dashboard JSON file(s) under /var/lib/grafana/dashboards/

  2. Add a provider in provisioning/dashboards/default.yaml (see § Dashboard provisioning below)

  3. Restart Grafana so the provider config is loaded

  4. Verify the dashboard landed:

    curl https://grafana.example.com/api/dashboards/uid/<uid> \
      -H "Authorization: Bearer <token>" | jq '.dashboard.title'

    Returns the title → success. 404 → provisioning didn't pick it up; check Grafana server logs (journalctl -u grafana-server | grep -i provisioning) for parse errors.

Provisioning data sources
  1. Write provisioning/datasources/datasources.yaml (see § Data source provisioning below)

  2. Restart Grafana

  3. Health-check the data source via API:

    curl https://grafana.example.com/api/datasources/uid/<uid>/health \
      -H "Authorization: Bearer <token>"
    # { "status": "OK", "message": "..." } → working
    # { "status": "ERROR", ... } → URL unreachable or auth misconfigured
Creating a service account + token
  1. Provision via YAML or POST /api/serviceaccounts (full API in references/api.md § Users + service accounts)

  2. Mint a token via POST /api/serviceaccounts/{id}/tokens

  3. Verify the token works:

    curl https://grafana.example.com/api/org \
      -H "Authorization: Bearer <new-token>"
    # 200 + org JSON → token + role assignment work
    # 401 → token wrong; 403 → role wrong

Dashboard provisioning

# provisioning/dashboards/default.yaml
apiVersion: 1
providers:
  - name: default
    folder: MyFolder
    type: file
    disableDeletion: false
    updateIntervalSeconds: 30
    options:
      path: /var/lib/grafana/dashboards
      foldersFromFilesStructure: true

For the dashboard JSON shape itself (panels, queries, template variables), see references/dashboard-json.md.

Data source provisioning

# provisioning/datasources/datasources.yaml
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true
    jsonData:
      timeInterval: 15s
      httpMethod: POST

  - name: Loki
    type: loki
    access: proxy
    url: http://loki:3100

  - name: Tempo
    type: tempo
    access: proxy
    url: http://tempo:3200
    jsonData:
      tracesToLogsV2:
        datasourceUid: loki_uid
        tags: [{ key: "service.name", value: "app" }]
      serviceMap:
        datasourceUid: prometheus_uid
      nodeGraph:
        enabled: true

  - name: Pyroscope
    type: grafana-pyroscope-datasource
    url: http://pyroscope:4040

RBAC (built-in roles)

RolePermissions
ViewerRead dashboards, alerts
EditorCreate/edit dashboards, alerts
AdminManage data sources, users, plugins
GrafanaAdminServer-wide admin (superuser)

Service-account provisioning:

# provisioning/access-control/service_accounts.yaml
apiVersion: 1
serviceAccounts:
  - name: ci-reader
    orgId: 1
    role: Viewer
    tokens:
      - name: ci-token
        # expires: optional ISO 8601 timestamp; omit for no-expiry tokens

(Custom RBAC roles with fine-grained permissions are Enterprise / Cloud only — see the grafana-cloud/admin skill if you need those.)

Plugin provisioning

# provisioning/plugins/plugins.yaml
apiVersion: 1
apps:
  - type: grafana-pyroscope-app
    disabled: false
    jsonData:
      backendUrl: http://pyroscope:4040

After restart, verify via GET /api/plugins/<plugin-id>/health.

References

  • references/dashboard-json.md — full dashboard JSON model + template variables + common problems (uid uniqueness, gridPos arithmetic, datasource uid matching)

  • references/dashboards.md — dashboard workflows, settings, variables, annotations, sharing, versions, playlists, and provisioning-as-code

  • references/datasources.md — data source setup and query examples for Prometheus, Loki, Tempo, SQL, CloudWatch, and plugins

  • references/panel-types.md — panel-type table + decision guide for picking the right one

  • references/panels.md — panel editor, visualization options, field config, transformations, query options, inspection, and performance tips

  • references/alerting.md — alerting concepts, contact points, notification policies, templates, silences, and common rule examples

  • references/api.md — full Grafana OSS API reference (dashboards, data sources, users, service accounts, annotations) with verification curls and common failure modes

  • references/config.md — grafana.ini server / database / SMTP / auth / security / feature-toggle config + restart-required issues

Files

references/panels.md

Grafana Panels and Visualizations - Detailed Reference

What is a Panel?

A panel is the basic building block of a Grafana dashboard. Each panel combines:

  • A query (or multiple queries) to a data source

  • A visualization type to display the data

  • Field configuration (units, thresholds, color mappings)

  • Optional transformations to reshape the data before display


Panel Editor

Open the panel editor by clicking a panel's title > Edit, or clicking Add visualization for a new panel.

Panel Editor Layout

Top bar: Back to dashboard, Discard changes, Save dashboard

Center: Visualization preview (live update as you configure)

Toggle: "Table view" - shows raw query results as a table for debugging

Right sidebar tabs:

  1. Query - configure data sources and write queries

  2. Transform - apply data transformations

  3. Alert - create alert rules from this panel

  4. Below tabs: visualization-specific options and field config

Query Tab
  • Data source selector: Choose which data source to query

  • Query editor: Data-source-specific interface (PromQL for Prometheus, LogQL for Loki, SQL for databases)

  • Query options:

    • Max data points: Limit data points fetched

    • Min interval: Minimum auto-calculated interval

    • Interval: Override the auto-calculated interval

    • Relative time: Override dashboard time range for this panel only

    • Time shift: Shift the time range (e.g., to compare to last week)

  • + Query: Add multiple queries (labeled A, B, C...)

  • Expression: Add server-side math expressions combining query results


Visualization Types

Time Series (default)

Best for: Metrics over time, continuous data

  • Renders as lines, points, or bars

  • Supports multiple series

  • Configurable line width, fill, point size

  • Supports thresholds as colored background regions

  • Supports annotations overlay

  • Graph styles: Lines, Bars, Points; can mix per series

  • Stacking: None, Normal, 100%

  • Axis: Left Y, Right Y, hidden

  • Default visualization - supports alerting

Stat

Best for: Single important metric (KPI display)

  • Shows one or more values as large text

  • Supports sparkline background

  • Color modes: value, background, none

  • Can show last value, mean, sum, etc.

  • Great for dashboards that need quick status overviews

Bar Chart

Best for: Comparing categorical data

  • Horizontal or vertical orientation

  • Grouped or stacked

  • Supports labels on bars

Gauge

Best for: Showing a value relative to min/max range

  • Circular gauge with arc

  • Configurable thresholds set colors

  • Shows current value prominently

Bar Gauge

Best for: Multiple metrics as horizontal/vertical bars

  • Useful for comparing many items

  • Supports thresholds for color coding

  • Modes: gradient, retro LCD, basic

Table

Best for: Tabular data, multi-column metrics

  • Supports sorting by column

  • Column width customization

  • Cell display modes: color text, color background, gradient gauge

  • Pagination for large datasets

  • Can embed sparklines in cells

Heatmap

Best for: Distribution over time, histogram-over-time

  • X axis: time; Y axis: buckets; Color: density/value

  • Supports pre-bucketed data (Prometheus histogram) and raw values

  • Tooltip shows exact bucket counts

Histogram

Best for: Value distribution analysis

  • Groups values into buckets

  • Can combine multiple series

  • Configurable bucket size

Pie Chart

Best for: Proportional data, parts-of-whole

  • Pie or donut style

  • Labels: name, value, percentage

Logs

Best for: Log data from Loki, Elasticsearch, etc.

  • Displays raw log lines with timestamp

  • Log level coloring (info/warn/error)

  • Search/filter within results

  • Deduplication and time wrapping

  • Prettify JSON option

Traces

Best for: Distributed tracing visualization (Tempo)

  • Renders trace spans as a waterfall/Gantt chart

  • Shows service name, operation, duration

  • Click to drill into trace details

Flame Graph

Best for: CPU profiling data (Pyroscope)

  • Visualizes call stacks by CPU time

  • Click to zoom into subtrees

Node Graph

Best for: Service dependency maps, network topology

  • Renders nodes and edges

  • Node color/size configurable by metric

Geomap

Best for: Geographic data visualization

  • Layers: markers, heatmap, route

  • Multiple base map options (OpenStreetMap, CARTO, etc.)

  • Supports GeoJSON data

Canvas

Best for: Custom layouts, process diagrams, status boards

  • Drag-and-drop element placement

  • Elements: text, metric value, rectangle, ellipse, icon, image, connections

  • Dynamic data binding per element

State Timeline

Best for: State changes over time (on/off, OK/warn/crit)

  • Horizontal bands showing state duration

  • Each series = one row

  • Color per state value

Status History

Best for: Periodic state checks over time

  • Grid: Y=services, X=time buckets

  • Color per state

XY Chart

Best for: Correlation between two metrics

  • Scatter plot

  • X and Y axis from different fields

  • Bubble size from a third field

Candlestick

Best for: Financial OHLC data

  • Open/High/Low/Close representation

  • Volume bars

Text

Best for: Documentation panels, headers

  • Renders Markdown or HTML

Alert List

Best for: Dashboard overview of current alert states

Dashboard List

Best for: Navigation panels linking to other dashboards


Field Configuration (Standard Options)

Available for most visualizations under the visualization options panel.

OptionDescription
UnitDisplay unit (bytes, seconds, %, requests/sec, etc.)
Min / MaxOverride auto-detected min/max for scales
DecimalsNumber of decimal places
Display nameOverride the series/field name
Color schemeFixed, thresholds-based, palette, etc.
No valueText to display when value is null
Thresholds

Define color-coded boundaries:

  • Absolute: Fixed numeric values (e.g., >90 = red, >70 = yellow, else green)

  • Percentage: Relative to min/max

Example threshold config:

Base (default): Green
70: Yellow (warn)
90: Red (crit)
Value Mappings

Transform raw values into human-readable labels or colors:

  • Value to text: e.g., 1 -> "OK", 0 -> "Down"

  • Range to text: e.g., 0-50 -> "Low"

  • Regex to text: Match patterns

Create clickable links from panel values:

  • Link to other dashboards with variable values interpolated

  • Link to external systems (e.g., Kibana, PagerDuty)

  • Use ${__value.raw} and ${__field.name} in URLs


Field Overrides

Apply specific field options to individual series/columns rather than all data:

  1. Click + Add field override in the Overrides section

  2. Choose override target:

    • Fields with name (exact match)

    • Fields with name matching regex

    • Fields with type (number, string, time)

    • Fields returned by query (A, B, C...)

  3. Add properties to override (unit, color, alias, thresholds, etc.)

Example: In a table with columns cpu_idle and cpu_used, set cpu_used to show as percentage and color by threshold while leaving cpu_idle with default styling.


Transformations

Transformations reshape query data before rendering. Apply multiple in sequence.

Access: Panel editor > Transform tab > Add transformation

Most-Used Transformations
TransformationDescription
ReduceCollapse a time series to a single value (last, mean, sum, max, min)
Filter by nameKeep only specific fields/columns
Filter by valueFilter rows where a field matches a condition
Organize fieldsRename, reorder, or hide fields
MergeCombine multiple query results into one table
Join by fieldSQL-style join on a common field (e.g., time)
Group byGroup rows and aggregate (count, sum, mean, etc.)
Sort bySort rows by a field
LimitKeep only first N rows
Add field from calculationAdd a new column computed from existing columns
Convert field typeChange a field's data type
Rename by regexBatch rename fields using regex
Extract fieldsParse JSON or regex from a string field
Labels to fieldsConvert label key/values into separate columns
Rows to fieldsPivot: turn row values into column headers
Prepare time seriesNormalize time series format
Time series to tableConvert time series format to table format

Enable "Debug" toggle on any transformation to see input/output for troubleshooting.


Query Options

Multiple queries

Add multiple queries (A, B, C...) to one panel. They are overlaid in the visualization. Use this to compare metrics or show multiple services on one graph.

Expressions (server-side)

Server-side expressions allow math across query results:

  • Math: $A + $B, $A / $B * 100

  • Reduce: Collapse a series to scalar

  • Resample: Change time resolution of a series

  • Classic conditions: Threshold logic (used in alerting)

Example - calculate error rate as percentage:

Query A: total_requests{job="api"}
Query B: error_requests{job="api"}
Expression C (Math): $B / $A * 100
Display C as percentage
Important query variables

These variables are available in queries:

VariableDescription
$__intervalAuto-calculated interval based on time range and resolution
$__rate_intervalInterval suitable for rate() functions (at least 4x scrape interval)
$__fromStart of the current time range (ms epoch)
$__toEnd of the current time range (ms epoch)
$__rangeDuration of current time range (e.g., "6h")
$__range_sDuration in seconds
$__range_msDuration in milliseconds

Example PromQL using interval variable:

rate(http_requests_total[${__rate_interval}])

Panel Inspect

Click panel menu (3-dot) > Inspect to access:

  • Data: Raw table view of the data powering the panel

  • Stats: Query performance (time, row count)

  • JSON: Panel JSON model

  • Query: Equivalent of query inspector showing raw query and response


Performance Tips

  1. Limit max data points to avoid over-fetching

  2. Use recording rules in Prometheus for expensive queries

  3. Set longer min intervals for historical dashboards

  4. Use $__interval variable in queries to align with time resolution

  5. Use $__rate_interval instead of hardcoded intervals for rate() queries

  6. Avoid too many panels on one dashboard (aim for <20)

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs network access

Security

What our scanner noticed· Medium risk

  • References to credential files
  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Grafana Labs
Publisher
Grafana Labs (Official)
Source
grafana/skills · skills/grafana-core/grafana-oss · commit 8fb72a5
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Grafana Labs or Grafana Labs.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download grafana-oss.zip