observability
Sentry
Sentry
Connect your Sentry organization to let agents query issues, search error events, check alert statuses, and investigate production incidents. Agents can analyze your error data to help troubleshoot issues, understand error patterns, and identify root causes.
連接
從終端機連接Sentry。傳入--help可查看Sentry接受的旗標。
Terminal
polylane integration connect --type sentry在你的Sentry組織上安裝Polylane整合。
透過Sentry的OAuth整合連接它,讓代理可以在調查期間查詢問題、錯誤與警示。
設定
- 點擊Connect啟動Sentry安裝流程。
- 選擇要安裝Polylane的Sentry組織。
- 檢視所請求的存取並accept安裝。
- 你會回到Polylane,整合已就緒。
連接會為每條issue警示規則加入一個Send a notification via Polylane動作,所以警示會落到Polylane並在觸發時被分流。
代理能做什麼
- 查詢issue並搜尋錯誤事件
- 檢視最新事件與issue詳細資料
- 檢查警示狀態並調查事件
中斷連接
在你Sentry組織的Settings → Integrations底下移除Polylane整合,或從Polylane中斷它的連接。中斷連接會從你的警示規則中移除Polylane動作,所以請同時從Terraform設定中拿掉它。
把Sentry的警示與你以Terraform管理的資源一起註冊到Polylane。
一個週期性同步會把Polylane通知動作加到每條issue警示規則,所以以Terraform管理的規則在該動作也進入其Terraform設定之前會顯示漂移。透過Sentry API的GET /api/0/organizations/{organization_slug}/sentry-app-installations/(Polylane應用程式的那一筆)找到你的安裝UUID,然後把該動作加到每條規則:
resource "sentry_issue_alert" "example" {
# ...
actions_v2 = concat(var.existing_actions, [
{
notify_event_sentry_app = {
sentry_app_installation_uuid = var.polylane_installation_uuid
}
}
])
}
中斷整合的連接會從你的警示規則中移除Polylane動作,所以請同時從Terraform設定中拿掉它。
中斷連接
中斷連接會停止所有同步與檢查,並刪除Polylane持有的憑證。 Polylane會移除Sentry的API允許它移除的東西。以下項目會留下,直到你自行移除:
- Sentry app installation and tokens
Terminal
polylane integration disconnect <id>工具
10代理可以在對話串中執行的操作。
Api
Call any Sentry REST endpoint that lacks a dedicated tool
Projects
Read Sentry projects (list, get, stats)
Issues
Read or update Sentry issues, events, tags, and hashes
Alert Rules
Read or create Sentry alerts (issue alert rules)
Metric Alerts
Read or create Sentry metric monitors (metric alert rules)
Incidents
Read Sentry metric alert firings
Replays
Read Sentry session replays
Dashboards
Read, create, or edit Sentry dashboards
Query Discover
Run a Discover query in Sentry
Query Timeseries
Run a Sentry events timeseries query