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

Integrate Spike with LangSmith

Send LangSmith alert webhooks to Spike so a tracing project's error, latency, feedback or cost alert pages your on-call rotation by phone, SMS, Slack or Teams.

LangSmith is LangChain's platform for tracing, evaluating and monitoring LLM applications. You can set an alert rule on a tracing project, for example "more than 10 errored runs in 5 minutes", and LangSmith calls a webhook when the rule's threshold is crossed.

Point that webhook at a Spike integration URL and a LangSmith alert pages your on-call rotation, titled with the sentence you wrote for the rule. Nothing is installed: one webhook on each alert rule is the whole setup.

What Spike does with each delivery

Delivery
What happens in Spike

The first alert from a rule

Opens an incident and pages your escalation policy

The same rule alerting again while its incident is open

Added as an event to that incident. It never pages again

The same rule firing after you resolved its incident

Reopens that same incident instead of opening a new one

A different rule

A separate incident, paged on its own

A delivery with no alert_rule_id

Matched to an open incident by title instead, so the same title joins and a different title opens a new incident

Incident identity

Spike identifies the incident by alert_rule_id, the UUID of the alert rule, which LangSmith documents as the de-duplication key and repeats on every firing of one rule. The title is for display only, so the readings can change from one firing to the next without opening a new incident.

Incident title

The title is the rule's alert_rule_description, which you write in LangSmith, with whitespace collapsed and cut at 200 characters (the cut ends in ...):

More than 10 support agent runs errored in the last 5 minutes

A rule with no description is titled from its name, the metric, the readings and the project (or the workspace when the project is empty):

  • The metric reads errors, feedback score, latency or cost for error_count, feedback_score, latency and cost. Any other alert_rule_attribute is shown with underscores replaced by spaces.

  • above or below is worked out by comparing triggered_metric_value with triggered_threshold, because the operator is not in the payload.

  • Numbers from ten up are whole with thousands separators (1,250), and below ten they keep two significant digits. No units are shown, because LangSmith does not say which unit a value is in.

The readings appear only when the delivery carries a usable alert_rule_id and both numbers are present, numeric and different. Without them the title is the rule name and project:

If the rule has no name, LangSmith errors alert (or LangSmith alert with no metric) stands in. A delivery with nothing usable is titled LangSmith alert with no details. Titles never contain ids, URLs or timestamps; those are on the incident page. A fallback title is also capped at 200 characters: the rule name is shortened and in {project} is kept whole.

Use a Title Remapper if you want a different format.

Severity

Spike does not read a severity from the payload. Write an alert rule on alert_rule_attribute or project_name if you want to set severity, route or suppress. Read more about priority and severity.

Prerequisites

  • A LangSmith workspace in which you can create alert rules on a tracing project

  • A Spike integration and its webhook URL

  • Nothing to open on your own network. LangSmith calls out to Spike

Step 1 — Create the integration in Spike

In Spike, go to Integrations → Add integration → LangSmith, attach it to a service and an escalation policy, and copy the webhook URL. It looks like https://hooks.spike.sh/<your-token>/push-events.

Create integration and service on our dashboard

Step 2 — Add a webhook to the alert rule in LangSmith

  1. Sign in to LangSmith at https://smith.langchain.com, switch to the workspace that owns your tracing project and open the project from Tracing Projects.

  2. Open the project's alerts. Select the Alerts tab, then create a new alert rule, or open an existing one to edit it.

  3. Set the rule. Choose the metric to watch (error count, feedback score, latency or cost), the threshold and the window. Give the rule a clear name, and write a description that says what is wrong in a sentence, because Spike uses it as the incident title.

  4. Add a webhook notification. In the rule's notification options choose Webhook and fill in:

    • URL (required) — the Spike URL from Step 1

    • Headers (required for Spike) — add {"Content-Type": "application/json"}

    • Request Body Template (required for Spike) — enter exactly {}. LangSmith adds its alert fields at the top level of whatever template you send, so Spike receives only those fields

  5. Save the rule.

With the template {}, the delivery is the body below. Spike reads alert_rule_id, alert_rule_description, alert_rule_name, alert_rule_attribute, triggered_metric_value, triggered_threshold, project_name and workspace_name. alert_rule_type, alert_rule_url, runs_url and timestamp are kept on the incident page but are not used. Only alert_rule_id decides whether a repeat firing of one rule joins the open incident; the others only shape the title. Spike does not require any of them, but LangSmith sends all twelve.

Archive an integration

Step 3 — Add a resolve timer

Because LangSmith never reports a recovery, open Settings on the Spike integration and set a resolve timer that suits how long your alerts usually last. Without one, every incident stays open until somebody resolves it.

Step 4 — Confirm it end to end

Send a test request with the example body below, or trigger the rule in LangSmith.

An incident opens on your service, titled:

Send it again and the second delivery lands on the same incident without paging. Resolve the test incident when you are done.

Payload reference

Field
Required
Used for

alert_rule_id

Recommended

Identifies the incident, and enables readings in the fallback title

alert_rule_description

No

The title, when it is not empty

alert_rule_name

No

The start of the fallback title

project_name

No

The in ... part of the fallback title, always kept whole

workspace_name

No

Used instead of project_name when the project is empty

alert_rule_attribute

No

The metric in words: error_count, feedback_score, latency and cost

triggered_metric_value, triggered_threshold

No

The readings and whether the value is above or below the threshold. A number or a numeric string

alert_rule_type, alert_rule_url, runs_url, timestamp

No

Kept on the incident page, never used

Spike keeps the whole body on the incident, so every field is available to alert rules and the Title Remapper as data.body.<field>.

Things worth knowing

  • One webhook per rule. Add the Spike webhook to each alert rule you want paged, or create several Spike integrations if teams own different projects.

  • No recovery. A cleared alert does not resolve its incident. Use the resolve timer.

  • Resolving in Spike does not touch LangSmith. The rule keeps running and will fire again, and that firing reopens the incident you resolved (same alert_rule_id).

Troubleshooting

Nothing arrives in Spike

Check that the URL on the rule is the full https://hooks.spike.sh/<your-token>/push-events, that the integration is not archived, and that the rule has actually fired. A webhook is only sent when the threshold is crossed.

The title is the rule name and project, not my description

The rule's description is empty, so Spike fell back to the name. Write a description on the rule in LangSmith.

Each firing opens a new incident

Compare alert_rule_id on two incidents. If it is missing from the payload, Spike can only match on the title, so a title that changes between firings opens a new incident. If the ids match, a firing after you resolved the first incident reopens that same incident, so two incidents with the same alert_rule_id are not expected. Report that to Spike support, and include both incident links and the alert_rule_id as sent.

The title has no readings

Readings only appear on the fallback title, and only when the delivery has an alert_rule_id and two different numbers for triggered_metric_value and triggered_threshold.

Disclaimer: These integration instructions are offered independently by Spike.sh, and Spike.sh is not affiliated with nor a partner of LangChain, Inc.

Last updated