NearIRM

Webhook Formats

Complete reference for NearIRM webhook payloads

Overview

NearIRM accepts alerts via HTTP webhooks. Each integration type has its own endpoint and expected payload format.

See Authentication for security best practices around webhook URLs.

Grafana Alertmanager

Endpoint:

POST https://irm.nearlunar.com/api/webhooks/grafana/{integrationId}

Request Format

NearIRM accepts the standard Grafana Alertmanager webhook format:

{
  "receiver": "webhook",
  "status": "firing",
  "alerts": [
    {
      "status": "firing",
      "labels": {
        "alertname": "HighErrorRate",
        "severity": "critical",
        "service": "api",
        "env": "production"
      },
      "annotations": {
        "summary": "Error rate above threshold",
        "description": "API service error rate is 8.2%, threshold is 5%"
      },
      "startsAt": "2024-01-15T10:30:00Z",
      "endsAt": "0001-01-01T00:00:00Z",
      "generatorURL": "https://grafana.example.com/alerting/grafana/abc123"
    }
  ],
  "groupLabels": {
    "alertname": "HighErrorRate"
  },
  "commonLabels": {
    "alertname": "HighErrorRate",
    "severity": "critical"
  },
  "commonAnnotations": {
    "summary": "Error rate above threshold"
  },
  "externalURL": "https://grafana.example.com"
}

Required Fields

FieldTypeDescription
alertsarrayList of alert objects
alerts[].statusstringfiring or resolved
alerts[].labelsobjectKey-value labels

Optional Fields

FieldTypeDescription
receiverstringReceiver name (informational)
statusstringOverall status
alerts[].annotationsobjectSummary and description
alerts[].startsAtstringISO 8601 timestamp
alerts[].endsAtstringISO 8601 timestamp
alerts[].generatorURLstringLink back to source
groupLabelsobjectLabels used for grouping
commonLabelsobjectLabels common to all alerts
commonAnnotationsobjectAnnotations common to all alerts
externalURLstringGrafana instance URL

Severity Mapping

NearIRM maps the severity label to internal levels:

Grafana LabelNearIRM Level
criticalCritical
warningHigh
infoLow
(not set)Medium

SigNoz

Endpoint:

POST https://irm.nearlunar.com/api/webhooks/signoz/{integrationId}

Request Format

NearIRM accepts the standard Prometheus Alertmanager webhook format used by SigNoz:

{
  "receiver": "signoz-alert",
  "status": "firing",
  "alerts": [
    {
      "status": "firing",
      "labels": {
        "alertname": "HighMemoryUsage",
        "severity": "critical",
        "service": "payments",
        "env": "production"
      },
      "annotations": {
        "summary": "Memory usage above 90%",
        "description": "Payments service memory at 92%, threshold is 90%"
      },
      "startsAt": "2024-01-15T10:30:00Z",
      "endsAt": "0001-01-01T00:00:00Z",
      "generatorURL": "https://signoz.example.com/alerts/abc123",
      "fingerprint": "abc123def456"
    }
  ],
  "groupLabels": {
    "alertname": "HighMemoryUsage"
  },
  "commonLabels": {
    "alertname": "HighMemoryUsage",
    "severity": "critical"
  },
  "commonAnnotations": {
    "summary": "Memory usage above 90%"
  },
  "externalURL": "https://signoz.example.com",
  "version": "4",
  "groupKey": "{}:{alertname=\"HighMemoryUsage\"}"
}

Required Fields

FieldTypeDescription
receiverstringReceiver name
statusstringfiring or resolved
alertsarrayList of alert objects (minimum 1)
alerts[].statusstringfiring or resolved
alerts[].labelsobjectKey-value labels (include alertname and severity)
alerts[].startsAtstringISO 8601 start timestamp
alerts[].fingerprintstringUnique alert fingerprint

Optional Fields

FieldTypeDescription
alerts[].annotationsobjectSummary and description
alerts[].endsAtstringISO 8601 end timestamp
alerts[].generatorURLstringLink back to SigNoz
groupLabelsobjectLabels used for grouping
commonLabelsobjectLabels common to all alerts
commonAnnotationsobjectAnnotations common to all alerts
externalURLstringSigNoz instance URL
versionstringAPI version
groupKeystringGroup key for deduplication

Severity Mapping

NearIRM maps the severity label to internal levels:

SigNoz LabelNearIRM Level
criticalCritical
errorHigh
warningMedium
infoInfo
p1Critical
p2High
p3Medium
p4Low
p5Info
(not set)Medium

Authentication

SigNoz sends the API key as a Bearer token. NearIRM supports two authentication methods:

  • Primary: Authorization: Bearer <api_key> header (SigNoz default)
  • Fallback: X-API-Key: <api_key> header (backward compatibility)

Generic Webhook

Endpoint:

POST https://irm.nearlunar.com/api/webhooks/generic/{integrationId}

Request Format

{
  "title": "High CPU Usage",
  "description": "Server cpu-01 is at 95% CPU utilization",
  "severity": "critical",
  "status": "firing",
  "source": "custom-monitor",
  "incidentKey": "cpu-01-high-cpu",
  "labels": {
    "host": "cpu-01",
    "env": "production",
    "team": "infrastructure"
  }
}

Required Fields

FieldTypeDescription
titlestringAlert title (displayed in list and notifications)

Optional Fields

FieldTypeDescriptionDefault
descriptionstringDetailed information(empty)
severitystringcritical, high, medium, low, infomedium
statusstringfiring or resolvedfiring
sourcestringSource identifierIntegration name
incidentKeystringDeduplication keyGenerated from title + labels
labelsobjectKey-value metadata(empty)

Deduplication

Alerts are deduplicated by their incident key:

  • If incidentKey provided, that exact value is used
  • Otherwise, a fingerprint is generated from title + labels
  • Same incident key + same integration = same alert
  • Duplicate firing events update existing alert
  • resolved event closes the alert

Response Format

Success (202 Accepted)

{
  "success": true,
  "message": "Alert queued for processing"
}

The 202 status means the webhook was received and queued. Actual processing happens asynchronously.

Error Responses

See Error Codes for detailed error responses.

Example: curl

Grafana Format

curl -X POST \
  'https://irm.nearlunar.com/api/webhooks/grafana/abc123def456' \
  -H 'Content-Type: application/json' \
  -d '{
    "alerts": [{
      "status": "firing",
      "labels": {
        "alertname": "TestAlert",
        "severity": "warning"
      },
      "annotations": {
        "summary": "Test alert from curl"
      }
    }]
  }'

SigNoz Format

curl -X POST \
  'https://irm.nearlunar.com/api/webhooks/signoz/abc123def456' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "receiver": "test",
    "status": "firing",
    "alerts": [{
      "status": "firing",
      "labels": {
        "alertname": "TestAlert",
        "severity": "warning"
      },
      "annotations": {
        "summary": "Test alert from curl"
      },
      "startsAt": "2024-01-15T10:30:00Z",
      "fingerprint": "test-fingerprint-001"
    }]
  }'

Generic Format

curl -X POST \
  'https://irm.nearlunar.com/api/webhooks/generic/abc123def456' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Test Alert",
    "description": "Testing webhook integration",
    "severity": "warning",
    "labels": {
      "source": "curl-test"
    }
  }'

Rate Limits

LimitValue
Requests per minute per integration100
Payload size1 MB
Alerts per request (Grafana)100
Alerts per request (SigNoz)100

Exceeding limits returns 429 Too Many Requests.

On this page