Provenance
Core Concepts

System Interactions

Interactions automatically created by the alert engine and notification queue.

Provenance creates interactions automatically when alerts fire or recover, and when notifications are delivered. These system interactions use the same schema as user-created interactions and appear in traces, activity search, and dashboards — giving you full observability over automated processes.

System entities

These entities are seeded into every tenant schema and should not be deleted.

Origins

MnemonicTitlePurpose
METRIC_EVALMetric EvaluatorAlert evaluation engine
NOTIFYNotification EngineNotification delivery tracking

Actions

MnemonicTitlePurpose
firedFiredAlert threshold exceeded (user-configured per alert)
recoveredRecoveredAlert threshold no longer exceeded (user-configured per alert)
notifiedNotifiedNotification successfully delivered
notify-errNotify FailedNotification delivery failed

Resource types

MnemonicTitlePurpose
ALERTAlertDefault resource type for alert interactions

Alert interactions

When a metric alert transitions between OK and FIRING states, an interaction is created automatically.

Interaction structure

FieldValue
resourceIdThe alert's UUID (alertId)
resourceTypeIdAlert's configured resource type, or system ALERT type
actionIdalertActionId when firing, recoveryActionId when recovering
originIdSystem METRIC_EVAL origin
externalReferencealert-{alertId}-firing-{timestamp} or alert-{alertId}-recovery-{timestamp}
uowIdnull (alert evaluations are standalone)

Interaction payload (firing)

{
  "alertId": "f3842099-f76a-4ed8-8a27-bce9b6d87d21",
  "alertTitle": "High Repo Push Frequency",
  "metricId": "891bb697-e13c-4083-9b99-85a1fd585dd8",
  "metricName": "Testing Metric Alerts",
  "metricType": "COUNT",
  "threshold": 2,
  "operator": "gte",
  "status": "exceeded",
  "value": 16,
  "dimensions": {},
  "evaluatedAt": "2026-04-09T10:03:35.108Z"
}

Interaction payload (recovery)

{
  "alertId": "f3842099-f76a-4ed8-8a27-bce9b6d87d21",
  "alertTitle": "High Repo Push Frequency",
  "metricId": "891bb697-e13c-4083-9b99-85a1fd585dd8",
  "metricName": "Testing Metric Alerts",
  "metricType": "COUNT",
  "threshold": 2,
  "operator": "gte",
  "status": "recovered",
  "value": 0,
  "dimensions": {},
  "evaluatedAt": "2026-04-09T10:05:06.995Z"
}

Payload field reference

FieldTypeDescription
alertIdUUIDThe alert that fired or recovered
alertTitlestringHuman-readable alert name
metricIdUUIDThe metric being monitored
metricNamestringHuman-readable metric name
metricTypestringMetric aggregation type (COUNT, SUM, AVG, etc.)
thresholdnumberThe configured threshold value
operatorstringComparison operator (gt, gte, lt, lte, eq, neq)
statusstring"exceeded" when firing, "recovered" when back to normal
valuenumberThe actual metric value at evaluation time
dimensionsobjectDimension values if the metric uses groupBy (e.g. {"country": "ZA"})
evaluatedAtISO dateWhen the evaluation occurred

Subscribing to alert interactions

You can create subscriptions that trigger when alerts fire — for example, to send a Slack message or email:

POST /api/subscriptions
{
  "resourceTypeId": "alert-sec-uuid",
  "actionId": "fired-action-uuid",
  "subscriberId": "slack-webhook-uuid",
  "config": {
    "text": "🚨 {{interaction.alertTitle}} — {{interaction.metricName}} is {{interaction.value}} (threshold: {{interaction.threshold}})"
  }
}

Notification interactions

When the notification queue processes a delivery, an interaction is created to track the result. This interaction carries the same uowId as the original interaction that triggered the notification, making the entire flow traceable.

Interaction structure

FieldValue
resourceIdSame as the original interaction's resourceId
resourceTypeIdSame as the original interaction's resourceTypeId
actionIdSystem notified action (success) or notify-err action (failure)
originIdSystem NOTIFY origin
uowIdSame as the original interaction — links delivery to the triggering event

Interaction payload (success)

{
  "subscriberName": "SendGrid Email",
  "subscriberId": "a1b2c3d4-...",
  "originalInteractionId": "e5f6g7h8-...",
  "adapter": "adapter:email",
  "status": "delivered",
  "statusCode": 202,
  "error": null
}

Interaction payload (failure)

{
  "subscriberName": "Slack Webhook",
  "subscriberId": "a1b2c3d4-...",
  "originalInteractionId": "e5f6g7h8-...",
  "adapter": "adapter:webhook",
  "status": "failed",
  "statusCode": 500,
  "error": "Connection timeout"
}

Payload field reference

FieldTypeDescription
subscriberNamestringName of the subscriber that received the notification
subscriberIdUUIDSubscriber UUID
originalInteractionIdUUIDThe interaction that triggered this notification
adapterstringAdapter used for delivery (e.g. adapter:email, adapter:webhook)
statusstring"delivered" on success, "failed" on error
statusCodenumberHTTP status code from the adapter
errorstring | nullError message if delivery failed

Trace example

With notification tracking, a single user action produces a complete trace:

UOW: 550e8400-e29b-41d4-a716-446655440000

1. [web-bff]  order / created    → order-456 created
2. [NOTIFY]   order / notified   → email sent to customer
3. [NOTIFY]   order / notified   → Slack notification to #orders channel

All three interactions share the same uowId, so querying the trace for order-456 shows the full lifecycle — from creation through notification delivery.


Querying system interactions

By origin

GET /api/interactions?origin=METRIC_EVAL
GET /api/interactions?origin=NOTIFY
POST /api/activity/search
{
  "filters": {
    "origins": ["METRIC_EVAL", "NOTIFY"],
    "startDate": "2026-04-01"
  }
}

In analytics

System interactions are included in analytics queries. You can build dashboards tracking:

  • Alert fire/recovery frequency over time
  • Notification delivery success rate
  • Average notification latency
  • Most active alert rules