# PagerDuty escalation

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

```python
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](/9.-improve-tune-the-system/daily-smoke-eval.md).

## See also

* [Notifications](https://github.com/LayerLens/gitbook-full/blob/main/13-reference/sdk-python/notifications.md) — in-app and email notifications (platform-native)
* [Cookbook: daily smoke eval](/9.-improve-tune-the-system/daily-smoke-eval.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.layerlens.ai/6.-build-wire-your-code/integration-pagerduty.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
