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
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 minutesA 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,latencyorcostforerror_count,feedback_score,latencyandcost. Any otheralert_rule_attributeis shown with underscores replaced by spaces.aboveorbelowis worked out by comparingtriggered_metric_valuewithtriggered_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.
Step 2 — Add a webhook to the alert rule in LangSmith
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.
Open the project's alerts. Select the Alerts tab, then create a new alert rule, or open an existing one to edit it.
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.
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
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.
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
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
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

