Skip to main content

Grafana OnCall → Regen: Field-by-Field Mapping

This document is the authoritative reference for how every Grafana OnCall API object maps to the corresponding Regen data model. It is the source of truth for the transformation layer in backend/internal/integrations/oncall/transform.go.


Users​

OnCall endpoint: GET /api/v1/users

OnCall fieldRegen fieldNotes
pk—Used internally to resolve references in shifts/escalations; not stored
emailusers.emailLowercased; required — users without email are skipped
nameusers.nameFalls back to username if empty
usernameusers.nameFallback only
role = "admin"users.role = "admin"
role = "user"users.role = "member"
role = "viewer"users.role = "viewer"
slack.user_idusers.slack_user_idSet if present
—users.auth_source = "local"All imported users use local auth
—users.active = true
—users.password_hashRandom temporary password; user sets own via setup token

Conflicts: If a user with the same email already exists in Regen, the user is skipped and added to conflicts[]. Existing users are never overwritten.

Not imported:

  • Notification policies (per-user paging rules) — planned for v1.1
  • Teams ID — not available in OnCall API
  • Phone number — OnCall does not expose this field

Teams​

OnCall endpoint: GET /api/v1/teams

Teams in Grafana OnCall have no direct equivalent in Regen. They are fetched for context but not imported. The team name may be added as a tag or label in a future release.


Schedules​

OnCall endpoints: GET /api/v1/schedules + GET /api/v1/on_call_shifts

Schedule​

OnCall fieldRegen fieldNotes
id—Used to match shifts; not stored
nameschedules.nameConflict if name already exists
time_zoneschedules.timezoneFalls back to "UTC" if empty
type—Not stored; Regen uses layer-based model for all types
team—Not stored
shifts[]schedule_layers[]Each shift becomes a layer

Shift → Schedule Layer​

Each shift in shifts[] maps to a schedule_layers row:

OnCall fieldRegen fieldNotes
id—Used to look up shift details
nameschedule_layers.nameFalls back to "Layer" if empty
levelschedule_layers.order_indexLayers sorted by level ascending
rotation_startschedule_layers.rotation_startISO 8601 → time.Time; falls back to start
durationschedule_layers.shift_duration_secondsSeconds; defaults to 1 week (604800) if 0
frequency = "weekly"schedule_layers.rotation_type = "weekly"
frequency = "daily"schedule_layers.rotation_type = "daily"
frequency = otherschedule_layers.rotation_type = "weekly"Safe default
rolling_users[][]schedule_participants[]Flattened in rotation order
users[]schedule_participants[]Used when rolling_users is empty
type = "override"—Override shifts are skipped; handled separately

Participants​

OnCall uses internal user IDs (pk) in rolling_users and users. During import, these IDs are resolved to display names using the imported user map. If a user ID cannot be resolved (user was skipped due to conflict or missing email), the raw OnCall ID is used as the participant name — the admin can correct this afterwards.

Not imported:

  • by_day, by_month, by_monthday (complex recurrence rules) — mapped to weekly/daily with the same participants; full recurrence requires manual adjustment
  • Schedule overrides — not imported in this version (future: import as schedule_overrides)
  • iCal schedules (type = "ical") — layers cannot be derived from an iCal URL; skipped with a warning

Escalation Policies​

OnCall endpoints: GET /api/v1/escalation_chains + GET /api/v1/escalation_policies

Escalation Chain → Escalation Policy​

OnCall fieldRegen fieldNotes
id—Used to group steps
nameescalation_policies.nameConflict if name already exists
team—Not stored
—escalation_policies.description = "Imported from Grafana OnCall"
—escalation_policies.enabled = true

Escalation Step → Escalation Tier​

Steps within a chain map to tiers, sorted by step index:

OnCall step typeRegen tierNotes
notify_personstarget_type = "users", user_names = [...]Persons resolved to display names
notify_person_next_each_timetarget_type = "users", user_names = [...]Same mapping; Regen rotates automatically
notify_on_call_from_scheduletarget_type = "schedule", schedule_id = <uuid>Schedule must have been imported; skipped if not
wait—Skipped; wait duration is absorbed conceptually into the next tier's timeout_seconds
resolve_incident—Not mappable; skipped
notify_whole_channel—Not mappable; skipped

Tier timeout: timeout_seconds defaults to 300 (5 min) unless the step has an explicit duration field set.

Not imported:

  • Steps that reference users or schedules not present in the import (conflict/skip)
  • Notify channel/team steps
  • notify_if_time_from_to steps (time-window conditions — not yet supported in Regen)

Integrations (Webhook URLs)​

OnCall endpoint: GET /api/v1/integrations

Grafana OnCall integrations are inbound webhook sources. They do not create new Regen objects — instead, the import returns a mapping table showing what URL in Regen to use as the replacement.

OnCall typeRegen webhook pathNotes
alertmanager/api/v1/webhooks/prometheusStandard Prometheus Alertmanager format
grafana/api/v1/webhooks/grafanaGrafana Unified Alerting format
cloudwatch/api/v1/webhooks/cloudwatchAWS CloudWatch via SNS
anything else/api/v1/webhooks/genericUse Regen generic webhook format

The user must manually update their Alertmanager / Grafana contact point configuration to point at the new Regen URLs.

Not imported:

  • inbound_email integrations — Regen does not have an inbound email receiver
  • escalation_chain linked to an integration — user must manually link the imported escalation policy to a routing rule in Regen

Alert Groups (incident history)​

OnCall endpoint: GET /api/v1/alert_groups

Not imported in this version. Resolved alert groups can optionally be imported as read-only historical incidents in a future release.


Summary: what transfers, what doesn't​

EntityStatusNotes
Users✅ FullEmail, name, role, Slack ID
Teams❌ Not importedNo Regen equivalent; future tag/label
Schedules (rotation layers)✅ FullTimezone, layers, participants, rotation type
Schedule overrides⚠️ SkippedPlanned for future release
iCal schedules⚠️ SkippedCannot derive layers from iCal URL
Escalation policies✅ FullChains → policies, steps → tiers
Complex escalation steps (wait, whole-team)⚠️ SkippedNot mappable to Regen model
Integrations (webhook URLs)✅ MappedNew Regen URLs provided; user updates source
Notification policies❌ Not importedPer-user paging rules — Regen v1.1
Alert groups / history❌ Not importedOptional future feature
Mobile push settings❌ Not applicableNeither product has mobile push