CtrlK
BlogDocsLog inGet started
Tessl Logo

grafana-oss

Grafana OSS core features — dashboards, panels, visualization types, data sources, template variables, alerting, annotations, provisioning, RBAC, service accounts, and configuration. Use when building dashboards, configuring data sources, setting up provisioning YAML, managing users and permissions, writing PromQL/LogQL/TraceQL in panels, or configuring Grafana server settings.

92

Quality

89%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Risky

Do not use without reviewing

SKILL.md
Quality
Evals
Security

Grafana OSS

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

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

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

Panel Types

PanelUse Case
Time seriesLine/bar charts over time (default for metrics)
StatSingle value with color thresholds
GaugeRadial gauge for current value
Bar gaugeHorizontal bars for comparisons
TableTabular data, sortable columns
LogsLog stream viewer (Loki)
TracesTrace visualization (Tempo)
HeatmapDistribution over time
HistogramValue distribution
Pie chartPart-to-whole ratios
GeomapGeographic data
CanvasCustom SVG-based layouts
Node graphService/topology graphs
Flame graphCPU/memory profiling
TextMarkdown/HTML content
Alert listShow firing alerts

Template Variables

{
  "templating": {
    "list": [
      {
        "name": "namespace",
        "type": "query",
        "datasource": { "type": "prometheus", "uid": "prom" },
        "definition": "label_values(kube_pod_info, namespace)",
        "includeAll": true,
        "multi": true
      },
      {
        "name": "env",
        "type": "custom",
        "query": "production,staging,dev",
        "current": { "value": "production" }
      },
      {
        "name": "interval",
        "type": "interval",
        "query": "1m,5m,15m,1h",
        "auto": true
      }
    ]
  }
}

Use variables in queries: rate(http_requests_total{namespace="$namespace"}[$interval])

Alerting Configuration (grafana.ini)

[alerting]
enabled = true

[unified_alerting]
enabled = true

[smtp]
enabled = true
host = smtp.gmail.com:587
user = alerts@example.com
password = yourpassword
from_address = alerts@example.com

Server Configuration (grafana.ini)

[server]
http_port = 3000
domain = grafana.example.com
root_url = https://grafana.example.com/

[database]
type = postgres
host = postgres:5432
name = grafana
user = grafana
password = secret

[auth.generic_oauth]
enabled = true
name = Okta
client_id = your_client_id
client_secret = your_secret
auth_url = https://your-org.okta.com/oauth2/v1/authorize
token_url = https://your-org.okta.com/oauth2/v1/token
api_url = https://your-org.okta.com/oauth2/v1/userinfo
scopes = openid profile email groups

[security]
admin_user = admin
admin_password = secret
allow_embedding = true       # for embedding dashboards

[feature_toggles]
enable = publicDashboards

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: 2025-01-01T00:00:00Z

Custom RBAC Roles (Enterprise / Cloud)

# provisioning/access-control/roles.yaml
apiVersion: 1
roles:
  - name: DashboardEditor
    description: Can create and edit dashboards
    permissions:
      - action: dashboards:create
      - action: dashboards:write
        scope: dashboards:*
      - action: folders:read
        scope: folders:*

Dashboard JSON Model

{
  "title": "Service Overview",
  "uid": "service-overview",
  "time": { "from": "now-1h", "to": "now" },
  "refresh": "30s",
  "panels": [
    {
      "type": "timeseries",
      "title": "Request Rate",
      "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 },
      "targets": [
        {
          "datasource": { "type": "prometheus" },
          "expr": "rate(http_requests_total{job=\"$job\"}[5m])",
          "legendFormat": "{{method}} {{status}}"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "reqps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              { "color": "green", "value": null },
              { "color": "red", "value": 1000 }
            ]
          }
        }
      }
    }
  ]
}

Annotations

# Create annotation via API
curl -X POST https://grafana.example.com/api/annotations \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "dashboardUID": "service-overview",
    "panelId": 1,
    "time": 1706745600000,
    "timeEnd": 1706749200000,
    "tags": ["deploy", "v2.0"],
    "text": "Deployed v2.0"
  }'

Plugin Provisioning

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

Key API Endpoints

# Search dashboards
GET /api/search?query=service&type=dash-db&folderIds=1

# Get dashboard
GET /api/dashboards/uid/{uid}

# Create/update dashboard
POST /api/dashboards/db
{ "dashboard": {...}, "folderUID": "...", "overwrite": true }

# List data sources
GET /api/datasources

# Create data source
POST /api/datasources

# List users
GET /api/org/users

# Create service account token
POST /api/serviceaccounts/{id}/tokens
Repository
grafana/skills
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.