Skip to content

Commit 424f05a

Browse files
clarify slack alert (#1776)
Co-authored-by: Mason Daugherty <mason@langchain.dev>
1 parent 4d6f72f commit 424f05a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/langsmith/alerts-webhook.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ Here is an example for configuring LangSmith alerts to send notifications to Sla
120120
3. Review the permissions and click **Allow**
121121
4. Copy the **Bot User OAuth Token** that appears (begins with `xoxb-`)
122122

123-
### Step 4: Configure the Webhook Alert in LangSmith
123+
### Step 4: Add the Bot to a Slack Channel
124+
125+
Add the bot to the specific channel you want to receive alerts in. You can add a bot to a Slack channel by mentioning it in the message field (e.g., `@botname`).
126+
127+
You also need the channel ID to configure the webhook alert in LangSmith. You can find the channel ID by opening channel details > About
128+
129+
### Step 5: Configure the Webhook Alert in LangSmith
124130

125131
1. In LangSmith, navigate to your project
126132
2. Select **Alerts → Create Alert**
@@ -135,6 +141,7 @@ https://slack.com/api/chat.postMessage
135141
```
136142

137143
**Headers**
144+
<Note>Replace `xoxb-your-token-here` with your Bot's User OAuth Token</Note>
138145

139146
```json
140147
{
@@ -143,9 +150,8 @@ https://slack.com/api/chat.postMessage
143150
}
144151
```
145152

146-
> **Note:** Replace `xoxb-your-token-here` with your actual Bot User OAuth Token
147-
148153
**Request Body Template**
154+
<Note>It is required to fill in the `{channel_id}` from the value found in Step 4. <br /><br />The remaining fields: `alert_name`, `project_name` and `project_url` optionally add additional context to the alert message. You can find your `project_url` in the browser's URL bar. Copy the portion up to but not including any query parameters.</Note>
149155

150156
```json
151157
{
@@ -177,17 +183,15 @@ https://slack.com/api/chat.postMessage
177183
}
178184
```
179185

180-
**NOTE:** Fill in the `channel_id`, `alert_name`, `project_name` and `project_url` when creating the alert. You can find your `project_url` in the browser's URL bar. Copy the portion up to but not including any query parameters.
181-
182186
6. Click **Save** to activate the webhook configuration
183187

184-
### Step 5: Test the Integration
188+
### Step 6: Test the Integration
185189

186190
1. In the LangSmith alert configuration, click **Test Alert**
187191
2. Check your specified Slack channel for the test notification
188192
3. Verify that the message contains the expected alert information
189193

190-
### (Optional) Step 6: Link to the Alert Preview in the Request Body
194+
### (Optional) Step 7: Link to the Alert Preview in the Request Body
191195

192196
After creating an alert, you can optionally link to its preview in the webhook's request body.
193197

@@ -197,7 +201,7 @@ To configure this:
197201

198202
1. Save your alert
199203
2. Find your saved alert in the alerts table and click it
200-
3. Copy the dsiplayed URL
204+
3. Copy the displayed URL
201205
4. Click "Edit Alert"
202206
5. Replace the existing project URL with the copied alert preview URL
203207

0 commit comments

Comments
 (0)