Opik alert notifications on your phone.

Get a push notification when Opik sees trace errors or guardrail hits, or when cost, latency or feedback scores cross a threshold.

trace:errorsAIMonitoring
How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into Opik

Add it as a webhook for Trace alert.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Opik trace alert webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In Opik, open Production > Alerts and create an alert with destination type General.
  3. Paste your webhook URL as the webhook URL and select the Trace alert events.https://••••••••/•••••••• your personal URL, shown after install
  4. Use Test trigger to send the example payload, then save.
  5. In Opik, open **Production → Alerts**, create an alert with destination type **General**, paste the URL above, and select the events you want: `trace:errors`, `trace:guardrails_triggered`, `trace:cost`, `trace:latency`, `trace:feedback_score` or `trace_thread:feedback_score`.
  6. **Test trigger** sends Opik's example payload. Opik groups events that happen close together, so one push can cover several traces.
  7. Opik can send a secret token as `Authorization: Bearer …`, but JustPush doesn't check it yet, so keep your endpoint URL private.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// Opik → alert
2// Fires when an Opik alert with a General webhook destination sees trace errors,
3// guardrail hits, or cost, latency or feedback score thresholds being crossed.
4// Docs: https://www.comet.com/docs/opik/production/alerts
5
6// Observability event types, how to label them, and how loud to be.
7const EVENTS = {
8 "trace:errors": { emoji: "❌", priority: 1 },
9 "trace:guardrails_triggered": { emoji: "🛡️", priority: 1 },
10 "trace:cost": { emoji: "💸", priority: 1 },
11 "trace:latency": { emoji: "🐢", priority: 0 },
12 "trace:feedback_score": { emoji: "👎", priority: 0 },
13 "trace_thread:feedback_score": { emoji: "👎", priority: 0 },
14}
15
16// Look a key up in one of the tables above, ignoring inherited names like "toString".
17function pick(table, key, fallback) {
18 return Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback
19}
20
21function handleRequest(request) {
22 const body = request.body || {}
23 const payload = body.payload ?? {}
24 const event = pick(EVENTS, body.eventType, null)
25
26 // Guard: only observability alerts; experiments and prompts have their own recipes.
27 if (!event) {
28 console.log(`Ignoring Opik "${body.eventType ?? "unknown"}" webhook`)
29 return null
30 }
31
32 const name = body.alertName ?? payload.alertName ?? "Opik alert"
33 // metadata is an object for threshold alerts and an array for per-trace events.
34 const meta = payload.metadata
35 const items = Array.isArray(meta) ? meta : []
36 let detail = null
37
38 if (meta && !Array.isArray(meta) && meta.metric_value != null) {
39 const metric = String(meta.metric_name ?? body.eventType).replace(/^trace(_thread)?:/, "").replace(/_/g, " ")
40 detail =
41 `${metric} ${meta.metric_value}` +
42 (meta.threshold != null ? ` (threshold ${meta.threshold})` : "") +
43 (meta.project_names ? ` · ${String(meta.project_names).split(",").join(", ")}` : "")
44 } else if (items.length) {
45 const first = items[0] ?? {}
46 const what = first.error_info
47 ? [first.error_info.exception_type, first.error_info.message].filter(Boolean).join(": ")
48 : [first.name, first.result, first.details?.message].filter(Boolean).join(" — ")
49 const count = Number(payload.eventCount) || items.length
50 detail =
51 (what || first.name || "Trace") +
52 (first.project_name ? ` · ${first.project_name}` : "") +
53 (count > 1 ? ` (+${count - 1} more)` : "")
54 }
55
56 return {
57 title: `${event.emoji} ${name}`,
58 message: detail ?? payload.message ?? "Alert triggered",
59 topic: "Opik",
60 priority: event.priority,
61 }
62}
Payload

The Opik trace:errors webhook

This is what Opik sends to your URL for trace alert. It is a sample, trimmed to the fields recipes use.

trace:errors · sample.json
1{
2 "id": "webhook-event-7f3a",
3 "alertId": "9b1d2c3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
4 "payload": {
5 "alertId": "9b1d2c3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
6 "message": "Alert 'Production errors': 2 trace:errors events aggregated",
7 "eventIds": [
8 "event-id-1",
9 "event-id-2"
10 ],
11 "metadata": [
12 {
13 "id": "trace-uuid-1",
14 "name": "handle_query",
15 "tags": [
16 "production"
17 ],
18 "error_info": {
19 "message": "Validation failed",
20 "exception_type": "ValidationException"
21 },
22 "project_name": "Support bot"
23 },
24 {
25 "id": "trace-uuid-2",
26 "name": "handle_query",
27 "tags": [
28 "production"
29 ],
30 "error_info": {
31 "message": "LLM call timed out",
32 "exception_type": "TimeoutError"
33 },
34 "project_name": "Support bot"
35 }
36 ],
37 "alertName": "Production errors",
38 "eventType": "trace:errors",
39 "userNames": [
41 ],
42 "eventCount": 2,
43 "aggregationType": "consolidated"
44 },
45 "alertName": "Production errors",
46 "createdAt": "2026-09-29T10:30:00Z",
47 "eventType": "trace:errors",
48 "workspaceId": "workspace-uuid"
49}
FAQ

Opik alert notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into Opik and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

Opik on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.