For the complete documentation index, see llms.txt. This page is also available as Markdown.

PagerDuty escalation

Recipe — escalate critical evaluation regressions to PagerDuty by polling and forwarding.

The Stratix platform doesn't ship a PagerDuty webhook integration today. Customers route alerts by:

  1. Running a scheduled job that calls the SDK's evaluation/trace-evaluation methods

  2. Inspecting the result

  3. Forwarding to PagerDuty's events API on failure

import os, requests
from layerlens import Stratix
client = Stratix()

# Run your release-gate or continuous evaluation
evaluation = client.evaluations.get(EVAL_ID_TO_MONITOR)

if not evaluation.is_success or evaluation.accuracy < 0.95:
 requests.post(
 "https://events.pagerduty.com/v2/enqueue",
 json={
 "routing_key": os.environ["PD_ROUTING_KEY"],
 "event_action": "trigger",
 "payload": {
 "summary": f"Stratix evaluation regression: {evaluation.id}",
 "severity": "critical",
 "source": "stratix",
 "custom_details": {
 "evaluation_id": evaluation.id,
 "status": str(evaluation.status),
 "accuracy": evaluation.accuracy,
 },
 },
 },
 timeout=10,
 )

Wire from any scheduler (cron, GitHub Actions schedule, Lambda, k8s CronJob) — same pattern as daily smoke eval.

See also

Last updated

Was this helpful?