> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/6.-build-wire-your-code/integration-pagerduty.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
