Skip to main content

Overview

Grafana is a popular open-source platform for monitoring and observability. EasyContact supports both Grafana’s Unified Alerting (Grafana 8+) and Legacy Alerting formats.
Grafana 8+ uses Unified Alerting by default. Legacy alerting is deprecated but still supported for older installations.

Setup Instructions

1

Create Integration in EasyContact

  1. Go to ConfigurationIntegrations
  2. Click Add Integration
  3. Select Grafana as the type
  4. Enter a name (e.g., “Production Grafana”)
  5. Save and copy the webhook URL
2

Create Contact Point (Unified Alerting)

  1. Go to AlertingContact points
  2. Click Add contact point
  3. Select Webhook as the type
  4. Paste your EasyContact webhook URL
  5. Save the contact point
3

Create Notification Policy

  1. Go to AlertingNotification policies
  2. Edit or create a policy
  3. Set the contact point to your EasyContact webhook
4

Test the Integration

Use the Test button in the contact point configuration to send a test alert

Unified Alerting Configuration

Contact Point Setup

  1. Navigate to AlertingContact points
  2. Click Add contact point
  3. Configure:
    • Name: EasyContact
    • Type: Webhook
    • URL: Your EasyContact webhook URL
    • HTTP Method: POST

Optional Settings

SettingRecommended Value
Max Alerts0 (unlimited)
Disable Resolved MessageNo (keep enabled)
HTTP Basic AuthNot required

Legacy Alerting Configuration

For Grafana 7.x and earlier with legacy alerting:
1

Create Notification Channel

  1. Go to AlertingNotification channels
  2. Click Add channel
  3. Select webhook as the type
2

Configure Webhook

  • Name: EasyContact
  • URL: Your EasyContact webhook URL
  • HTTP Method: POST
  • Send on all alerts: Yes
  • Include image: Optional

Field Mapping

Unified Alerting

Grafana FieldEasyContact Field
labels.alertnameTitle
annotations.summaryTitle (fallback)
annotations.descriptionDescription
statusStatus (firing → problem, resolved → ok)
labels.severitySeverity
labels.instanceHost
labels.jobService
fingerprintEvent ID

Legacy Alerting

Grafana FieldEasyContact Field
ruleNameTitle
messageDescription
stateStatus
ruleUrlURL
evalMatchesMetric details

Severity Mapping

Default Mapping

Grafana SeverityEasyContact Severity
criticalCritical
highHigh
warningWarning
infoInfo

Legacy State Mapping

Grafana StateEasyContact Status
alertingProblem
okOK
pendingProblem (warning)
no_dataProblem (warning)

Example Payloads

Unified Alerting Payload

{
  "receiver": "easycontact",
  "status": "firing",
  "alerts": [
    {
      "status": "firing",
      "labels": {
        "alertname": "HighCPU",
        "severity": "critical",
        "instance": "server-01",
        "grafana_folder": "Infrastructure"
      },
      "annotations": {
        "summary": "High CPU usage detected",
        "description": "CPU usage exceeded 90%",
        "runbook_url": "https://wiki.example.com/runbooks/high-cpu"
      },
      "startsAt": "2024-01-15T10:30:00Z",
      "endsAt": "0001-01-01T00:00:00Z",
      "fingerprint": "abc123",
      "silenceURL": "https://grafana.example.com/alerting/silence/new",
      "dashboardURL": "https://grafana.example.com/d/abc123",
      "panelURL": "https://grafana.example.com/d/abc123?viewPanel=1"
    }
  ],
  "groupLabels": {},
  "commonLabels": {
    "alertname": "HighCPU"
  },
  "commonAnnotations": {},
  "externalURL": "https://grafana.example.com",
  "orgId": 1
}

Legacy Alerting Payload

{
  "dashboardId": 1,
  "evalMatches": [
    {
      "value": 95.5,
      "metric": "cpu_usage",
      "tags": {
        "host": "server-01"
      }
    }
  ],
  "imageUrl": "https://grafana.example.com/render/...",
  "message": "CPU usage is above threshold",
  "orgId": 1,
  "panelId": 2,
  "ruleId": 1,
  "ruleName": "High CPU Alert",
  "ruleUrl": "https://grafana.example.com/d/abc123",
  "state": "alerting",
  "tags": {
    "environment": "production"
  },
  "title": "[Alerting] High CPU Alert"
}

Grafana-Specific Features

Grafana includes helpful links in alerts:
FieldDescription
dashboardURLLink to the dashboard
panelURLDirect link to the panel
silenceURLQuick link to silence the alert
generatorURLLink to the alert rule
These are captured and displayed in the incident details.

Alert Rule Examples

CPU Alert Rule (Unified)

apiVersion: 1
groups:
  - name: Infrastructure
    rules:
      - uid: high-cpu
        title: High CPU Usage
        condition: C
        data:
          - refId: A
            datasourceUid: prometheus
            model:
              expr: 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
          - refId: C
            datasourceUid: __expr__
            model:
              type: threshold
              conditions:
                - evaluator:
                    type: gt
                    params: [90]
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "High CPU usage on {{ index $labels \"instance\" }}"
          description: "CPU usage is {{ $values.A }}%"

Enrichment Examples

{
  "enrichment": {
    "tags.source": "grafana",
    "tags.environment": "production",
    "tags.team": "platform"
  }
}

Troubleshooting

  1. Test the contact point from Grafana UI
  2. Check Grafana server logs for webhook errors
  3. Verify network connectivity to EasyContact
  4. Ensure notification policy routes to correct contact point
  1. Verify “Disable Resolved Message” is NOT checked
  2. Check notification policy includes resolved alerts
  3. Verify alert rule has proper conditions for resolution
  1. Check which alerting system is enabled in Grafana
  2. EasyContact auto-detects format, but verify payload structure
  3. Review webhook samples for actual format being sent

Best Practices

Migrate to Unified Alerting for better features and consistency with Prometheus/Alertmanager format.
Add runbook_url annotation to help responders quickly find remediation steps.
Use Grafana folders to organize alerts and include folder name in labels.
Set Grafana’s external URL properly so dashboard links work correctly.