Skip to content

[NA] [DOCS] alerts: you can alert on custom metrics, and the new alert form - #8086

Open
aswynz wants to merge 3 commits into
mainfrom
aswynz/document-alerting-on-custom-metrics
Open

[NA] [DOCS] alerts: you can alert on custom metrics, and the new alert form#8086
aswynz wants to merge 3 commits into
mainfrom
aswynz/document-alerting-on-custom-metrics

Conversation

@aswynz

@aswynz aswynz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Details

Docs only. Five things, all on the alerts page except where noted:

  1. New intro. It now says what alerts are for and frames setup as the two decisions you actually make: when do you want to be alerted (event type + filter conditions), and who to notify and how (the destination). The old opening led with webhooks, which is the mechanism, not the point. "Creating an alert" below it is unchanged.

  2. Event type table. All ten events in one table with their event type and a one-line trigger summary; each name jumps to its full description. Those descriptions were bold text with no anchors, so the ten names are now headings — which also puts them in the page nav.

  3. Say that custom metrics can be alerted on. A customer read this page and thought only Opik's own metrics could have thresholds. You can't tell from the page, because it lists the events but never says where feedback scores come from. Alerts match on a score name, and any score in the project counts — so custom metrics already work. Added a short note.

  4. Keep the detail on the custom metrics page. How to get a custom metric scoring production traces is a custom-metrics topic. That content now lives in custom_metric.mdx. The alerts page keeps only the note above, one alert-specific caveat (the score has to be on a production trace), and a link.

  5. Follow the new alert form from [OPIK-8198] [FE] alerts: put Triggers before Webhook settings #8099. The step-by-step described the old layout. Rewritten: triggers before webhook settings, Test connection next to the Endpoint URL, per-trigger "Example payload" and "Test trigger", the name suggested from your first trigger and set last, "Enable alert" edit-only. Slack and PagerDuty setup steps reordered to match.

Also fixed a Custome typo on the online evaluation page.

Change checklist

  • User facing
  • Documentation update

Issues

No ticket — [NA]. Came out of a support question about alerting on custom metrics.

Depends on #8099 (OPIK-8198), which ships the form changes in point 5. Please merge this after that one, or the step-by-step will describe a UI that isn't live yet.

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: Claude Code
  • Model(s): Claude Opus 5
  • Scope: Wrote the docs prose and this description. No product code.
  • Human verification: Author set the direction and approved the changes. Claims were checked against this repo's source, not written from memory — details under Testing.

Testing

Docs only, so no test suite. What I did:

  • fern check0 errors. The 4 warnings are pre-existing and unrelated (unauthenticated redirect check, two colour-contrast warnings, a ${POSTHOG_API_HOST} placeholder).
  • Ran fern docs dev and loaded all three pages. Confirmed each of the 10 table links points at an anchor that actually exists in the rendered page, the table renders as a table, and the cross-page links resolve. Note: the dev server logs a successful reload but keeps serving the old page — it needs a restart to check properly.
  • Checked the behaviour claims against source rather than assuming:
    • Score name is a free-form string, not a fixed list — MetricsAlertJob.java:440.
    • The query doesn't care who wrote the score — ProjectMetricsDAO.java:980-991 matches on name only.
    • The dropdown is built from score names already logged, hence the "log one score first" note — FeedbackDefinitionsAndScoresSelectBox.tsx:116-143.
    • A window with no scores is skipped, not fired — MetricsAlertJob.java:246-253. Basis for the window guidance.
    • Form wording matches [OPIK-8198] [FE] alerts: put Triggers before Webhook settings #8099: Test connection on the Endpoint URL row, Example payload / Test trigger per trigger, name suggestions from alertNameHelpers.ts (e.g. Trace errors > 5 in 5 mins, Trace feedback score: policy_compliance < 0.8), Enable alert edit-only.

Not done:

Documentation

This PR is the documentation change:

  • production/alerts/alerts.mdx
  • evaluation/metrics/custom_metric.mdx
  • production/online-evaluation/rules.mdx

Two things for a docs owner

  • The page calls these triggers "… threshold exceeded". The UI says "… threshold", and "exceeded" is misleading anyway since the operator can be < — the usual choice for a quality metric. I kept the existing names so the new table matches the headings; happy to rename both in a follow-up.
  • I wrote that human review and annotation queue scores can be alerted on. That follows from the query above, but I didn't test it in a live workspace.

🤖 Generated with Claude Code

The alerts page listed the ten alert event types but never said where
feedback scores come from, so the closed list of event types read as a
closed list of alertable metrics. Nothing linked custom metrics to alerts
in either direction.

Feedback score alerts threshold on a score *name* and the query applies
no filter on which system produced the score, so any score logged to a
project is alertable — including custom metrics, whether they run as an
online evaluation rule or are scored in the user's own pipeline and
pushed via log_traces_feedback_scores / the REST API.

- alerts: expand the Feedback Score Name bullet and add an "Alerting on
  custom metrics" section covering both paths, plus the two real limits
  (offline experiment metrics are not thresholdable; the window must be
  wider than the scoring cadence or the alert is skipped for lack of
  data).
- custom metrics: add a production section and a What's next link, so the
  page a user lands on first points at alerts.
- online evaluation: note that custom rule scores can drive alerts, and
  fix a "Custome" typo.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aswynz
aswynz requested review from a team as code owners August 31, 2026 18:07
@github-actions github-actions Bot added documentation Improvements or additions to documentation 🟢 size/S labels Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⏱️ pre-commit per-hook timing

No linted files changed — nothing to run.

⏭️ 44 skipped (no matching files changed)
Hook Description Result
🐍 trim trailing whitespace — python sdk Strip trailing whitespace ⏭️
🐍 fix end of files — python sdk Ensure files end in a newline ⏭️
🐍 ruff — python sdk Lint + autofix Python (ruff) ⏭️
🐍 ruff-format — python sdk Format Python code (ruff) ⏭️
🐍 mypy — python sdk Static type check ⏭️
🤖 trim trailing whitespace — optimizer Strip trailing whitespace ⏭️
🤖 fix end of files — optimizer Ensure files end in a newline ⏭️
🤖 check yaml — optimizer Validate YAML syntax ⏭️
🤖 check json — optimizer Validate JSON syntax ⏭️
🤖 check toml — optimizer Validate TOML syntax ⏭️
🤖 check for added large files — optimizer Block large files (>1MB) ⏭️
🔐 detect private key — optimizer Block committed private keys ⏭️
🤖 check for merge conflicts — optimizer Block merge-conflict markers ⏭️
🤖 check for case conflicts — optimizer Block case-only name clashes ⏭️
🤖 pyupgrade — optimizer Modernize Python syntax ⏭️
🤖 ruff — optimizer Lint + autofix Python (ruff) ⏭️
🤖 ruff-format — optimizer Format Python code (ruff) ⏭️
🤖 mypy — optimizer Static type check ⏭️
📓 nbstripout — optimizer notebooks Strip notebook output ⏭️
📝 markdownlint — optimizer Lint Markdown ⏭️
🔤 codespell — optimizer Fix common misspellings ⏭️
📊 radon cc — optimizer Cyclomatic-complexity gate ⏭️
📊 radon raw — optimizer Raw size metrics gate ⏭️
📊 xenon — optimizer Fail on complexity thresholds ⏭️
📊 lizard — optimizer Cyclomatic-complexity gate ⏭️
🧹 vulture — optimizer Find dead code ⏭️
🛡️ trim trailing whitespace — guardrails Strip trailing whitespace ⏭️
🛡️ fix end of files — guardrails Ensure files end in a newline ⏭️
🛡️ ruff — guardrails Lint + autofix Python (ruff) ⏭️
🛡️ ruff-format — guardrails Format Python code (ruff) ⏭️
🛡️ mypy — guardrails Static type check ⏭️
⚓ helm-docs Regenerate Helm chart README ⏭️
block non-public FE plugins Block non-public FE plugins ⏭️
☕ spotless — java backend Format Java code ⏭️
🧪 pre-commit wrapper smoke tests Self-test the wrapper scripts ⏭️
🧪 rebaseline script tests Self-test the changelog re-baseline script ⏭️
🌐 eslint — frontend Lint + autofix JS/TS ⏭️
🌐 typecheck — frontend Whole-project tsc type check ⏭️
📘 eslint — typescript sdk Lint + autofix JS/TS ⏭️
📘 typecheck — typescript sdk Whole-project tsc type check ⏭️
⚙️ actionlint — github workflows Lint GitHub Actions workflows ⏭️
🐳 hadolint — dockerfiles Lint Dockerfiles ⏭️
🌈 zizmor — github workflows security Security-scan GitHub Actions workflows ⏭️
🛡️ semgrep — java backend sql Block SQL injection-prone string formatting ⏭️

@CometActions

CometActions commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

No test needed here.

No product surface in this PR — only docs, CI, tests, lockfiles or other non-product files.

Run

Advisory, from the QA test radar. Nothing here blocks this PR, and anything it proposes is a draft for review.

Re-checked after a push on 02 Sep 19:45 UTC.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🌿 Preview your docs: https://opik-preview-01a063a6-c794-77c6-8318-bdc48ed6eea3.docs.buildwithfern.com/docs/opik

No broken links found

Unverified links (timeout / rate-limited / server error — not failing the check)

https://aistudio.google.com/apikey (401)
↳ on page: /docs/opik/development/optimization-runs/optimization/configure_models
https://clickhouse.com/docs/concepts/features/backup-restore/overview (530)
↳ on page: /docs/opik/self-host/backup
https://clickhouse.com/docs/guides/sizing-and-hardware-recommendations (530)
↳ on page: /docs/opik/self-host/scaling
https://console.cloud.google.com/iam-admin/iam (401)
↳ on page: /docs/opik/administration/workspace-settings/ai_providers
https://console.cloud.google.com/iam-admin/roles (401)
↳ on page: /docs/opik/administration/workspace-settings/ai_providers
https://console.cloud.google.com/iam-admin/serviceaccounts (401)
↳ on page: /docs/opik/administration/workspace-settings/ai_providers
https://console.mistral.ai/api-keys/ (timeout)
↳ on page: /docs/opik/integrations/mistral
https://console.x.ai/ (403)
↳ on page: /docs/opik/integrations/xai-grok
https://docs.predibase.com/integrations/comet (403)
↳ on page: /docs/opik/integrations/predibase
https://learn.microsoft.com/en-us/semantic-kernel/concepts/enterprise-readiness/observability/telemetry-with-console?tabs=Powershell-CreateFile%2CEnvironmentFile&pivots=programming-language-python (timeout)
↳ on page: /docs/opik/integrations/semantic-kernel
https://learn.microsoft.com/en-us/semantic-kernel/overview/ (timeout)
↳ on page: /docs/opik/integrations/semantic-kernel
https://openrouter.ai/docs (530)
↳ on page: /docs/opik/integrations/openrouter
https://openrouter.ai/docs/features/structured-outputs (530)
↳ on page: /docs/opik/integrations/openrouter
https://portal.azure.com/ (403)
↳ on page: /docs/opik/administration/workspace-settings/ai_providers
https://www.together.ai/ (timeout)
↳ on page: /docs/opik/integrations/together-ai
https://x.ai/ (403)
↳ on page: /docs/opik/integrations/xai-grok


📌 Results for commit 6e287db

…ow the new alert form

Two changes.

Custom metric content now lives on the custom metrics page, where it
belongs. The alerts page keeps only a short note that custom metrics can
be alerted on, plus the one alert-specific caveat (the score must be on a
production trace), and links out for the rest. The two ways to get a
custom metric scoring production traces, the code sample and the window
guidance moved to custom_metric.mdx under "Using your custom metric in
production".

The step-by-step guide now follows the reworked alert form from #8099
(OPIK-8198):

- Triggers come before webhook settings.
- Test connection sits on the Endpoint URL row; the separate test panel
  is gone. Each trigger has its own "Example payload" toggle and
  "Test trigger" button.
- The name is suggested from the first trigger and comes last; new alerts
  are enabled on create, and "Enable alert" is an edit-only control at the
  bottom of the form.
- The Slack and PagerDuty setup lists follow the same order.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aswynz aswynz changed the title [NA] [DOCS] docs: clarify that alerts can threshold on custom metrics [NA] [DOCS] alerts: you can alert on custom metrics, and the new alert form Sep 2, 2026
Intro now says what an alert is for and frames setup as the two decisions
a user actually makes — when to be alerted (event type plus filter
conditions) and who to notify and how (the destination). The old opening
led with the webhook mechanism, which is the implementation detail rather
than the point.

Under "Supported event types", add a table of all ten events with their
event type and a one-line trigger summary. Each name links to that event's
full description. The descriptions were bold text with no anchors to link
to, so promote the ten names to headings; they now appear in the page nav
too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation 🟡 size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants