|
| 1 | +--- |
| 2 | +title: Seer |
| 3 | +sidebar_order: 7 |
| 4 | +description: "Learn more about Sentry's integration platform Seer webhooks for Issue Fix analysis notifications." |
| 5 | +--- |
| 6 | + |
| 7 | +Sentry integrations that have subscribed to Seer webhooks can receive notifications about the Seer [Issue Fix](/product/ai-in-sentry/seer/issue-fix/) process. These webhooks allow you to track the progress of automated root cause analysis, solution generation, and code fixes. |
| 8 | + |
| 9 | +## Sentry-Hook-Resource Header |
| 10 | + |
| 11 | +`'Sentry-Hook-Resource': 'seer'` |
| 12 | + |
| 13 | +## Webhook Types |
| 14 | + |
| 15 | +Seer webhooks support seven different event types that track the complete lifecycle of AI-powered issue resolution: |
| 16 | + |
| 17 | +### Root Cause Analysis |
| 18 | +- `seer.root_cause_started` - Triggered when root cause analysis begins |
| 19 | +- `seer.root_cause_completed` - Triggered when root cause analysis completes with results |
| 20 | + |
| 21 | +### Solution Generation |
| 22 | +- `seer.solution_started` - Triggered when solution generation begins |
| 23 | +- `seer.solution_completed` - Triggered when a solution has been generated |
| 24 | + |
| 25 | +### Code Generation |
| 26 | +- `seer.coding_started` - Triggered when code generation/fixing begins |
| 27 | +- `seer.coding_completed` - Triggered when code changes are ready |
| 28 | +- `seer.pr_created` - Triggered when pull request(s) are created |
| 29 | + |
| 30 | +## Common Attributes |
| 31 | + |
| 32 | +All Seer webhooks share these common attributes: |
| 33 | + |
| 34 | +### action |
| 35 | + |
| 36 | +- type: string |
| 37 | +- description: The specific Seer event that occurred (e.g., `root_cause_started`, `solution_completed`) |
| 38 | + |
| 39 | +### data['run_id'] |
| 40 | + |
| 41 | +- type: integer |
| 42 | +- description: Unique identifier for this Seer analysis run |
| 43 | + |
| 44 | +### data['group_id'] |
| 45 | + |
| 46 | +- type: integer |
| 47 | +- description: The Sentry issue ID being analyzed |
| 48 | + |
| 49 | +## Event-Specific Payloads |
| 50 | + |
| 51 | +### Root Cause Started |
| 52 | + |
| 53 | +Minimal payload indicating analysis has begun: |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "action": "root_cause_started", |
| 58 | + "actor": { |
| 59 | + "id": "sentry", |
| 60 | + "name": "Sentry", |
| 61 | + "type": "application" |
| 62 | + }, |
| 63 | + "data": { |
| 64 | + "run_id": 12345, |
| 65 | + "group_id": 1170820242 |
| 66 | + }, |
| 67 | + "installation": { |
| 68 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +### Root Cause Completed |
| 74 | + |
| 75 | +Includes the identified root cause: |
| 76 | + |
| 77 | +```json |
| 78 | +{ |
| 79 | + "action": "root_cause_completed", |
| 80 | + "actor": { |
| 81 | + "id": "sentry", |
| 82 | + "name": "Sentry", |
| 83 | + "type": "application" |
| 84 | + }, |
| 85 | + "data": { |
| 86 | + "run_id": 12345, |
| 87 | + "group_id": 1170820242, |
| 88 | + "root_cause": { |
| 89 | + "description": "Woah wow there's a bug here.", |
| 90 | + "steps": [ |
| 91 | + { |
| 92 | + "title": "User navigates to the dashboard page, initiating page load.", |
| 93 | + "code_snippet_and_analysis": "The user's browser sends a GET request to `/dashboard`. This is the entry point for the issue.", |
| 94 | + "timeline_item_type": "human_action", |
| 95 | + "relevant_code_file": { |
| 96 | + "file_path": "N/A", |
| 97 | + "repo_name": "N/A" |
| 98 | + }, |
| 99 | + "is_most_important_event": false |
| 100 | + }, |
| 101 | + { |
| 102 | + "title": "Next.js server renders the /dashboard route.", |
| 103 | + "code_snippet_and_analysis": "The Next.js server processes the request and hits the bug", |
| 104 | + "timeline_item_type": "internal_code", |
| 105 | + "relevant_code_file": { |
| 106 | + "file_path": "src/app/page.ts", |
| 107 | + "repo_name": "owner/repo" |
| 108 | + }, |
| 109 | + "is_most_important_event": true |
| 110 | + } |
| 111 | + ] |
| 112 | + } |
| 113 | + }, |
| 114 | + "installation": { |
| 115 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 116 | + } |
| 117 | +} |
| 118 | +``` |
| 119 | + |
| 120 | +### Solution Started |
| 121 | + |
| 122 | +Minimal payload indicating solution generation has begun: |
| 123 | + |
| 124 | +```json |
| 125 | +{ |
| 126 | + "action": "solution_started", |
| 127 | + "actor": { |
| 128 | + "id": "sentry", |
| 129 | + "name": "Sentry", |
| 130 | + "type": "application" |
| 131 | + }, |
| 132 | + "data": { |
| 133 | + "run_id": 12345, |
| 134 | + "group_id": 1170820242 |
| 135 | + }, |
| 136 | + "installation": { |
| 137 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 138 | + } |
| 139 | +} |
| 140 | +``` |
| 141 | + |
| 142 | +### Solution Completed |
| 143 | + |
| 144 | +Includes the generated solution details: |
| 145 | + |
| 146 | +```json |
| 147 | +{ |
| 148 | + "action": "solution_completed", |
| 149 | + "actor": { |
| 150 | + "id": "sentry", |
| 151 | + "name": "Sentry", |
| 152 | + "type": "application" |
| 153 | + }, |
| 154 | + "data": { |
| 155 | + "run_id": 12345, |
| 156 | + "group_id": 1170820242, |
| 157 | + "solution": { |
| 158 | + "description": "Definitely need to fix this.", |
| 159 | + "steps": [ |
| 160 | + { |
| 161 | + "title": "Go fix it", |
| 162 | + }, |
| 163 | + { |
| 164 | + "title": "Then go fix this other thing.", |
| 165 | + }, |
| 166 | + ], |
| 167 | + |
| 168 | + } |
| 169 | + }, |
| 170 | + "installation": { |
| 171 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 172 | + } |
| 173 | +} |
| 174 | +``` |
| 175 | + |
| 176 | +### Coding Started |
| 177 | + |
| 178 | +Minimal payload indicating code generation has begun: |
| 179 | + |
| 180 | +```json |
| 181 | +{ |
| 182 | + "action": "coding_started", |
| 183 | + "actor": { |
| 184 | + "id": "sentry", |
| 185 | + "name": "Sentry", |
| 186 | + "type": "application" |
| 187 | + }, |
| 188 | + "data": { |
| 189 | + "run_id": 12345, |
| 190 | + "group_id": 1170820242 |
| 191 | + }, |
| 192 | + "installation": { |
| 193 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 194 | + } |
| 195 | +} |
| 196 | +``` |
| 197 | + |
| 198 | +### Coding Completed |
| 199 | + |
| 200 | +Includes details about the code changes made: |
| 201 | + |
| 202 | +```json |
| 203 | +{ |
| 204 | + "action": "coding_completed", |
| 205 | + "actor": { |
| 206 | + "id": "sentry", |
| 207 | + "name": "Sentry", |
| 208 | + "type": "application" |
| 209 | + }, |
| 210 | + "data": { |
| 211 | + "run_id": 12345, |
| 212 | + "group_id": 1170820242, |
| 213 | + "changes": [ |
| 214 | + { |
| 215 | + "repo_name": "my-app", |
| 216 | + "repo_external_id": "12345", |
| 217 | + "title": "fix: Initialize undefined variable", |
| 218 | + "description": "This change initializes the 'blooopy' variable before use to prevent ReferenceError", |
| 219 | + "diff": "<the diff as a string>", |
| 220 | + "branch_name": "seer/fix-this-thing", |
| 221 | + } |
| 222 | + ] |
| 223 | + }, |
| 224 | + "installation": { |
| 225 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 226 | + } |
| 227 | +} |
| 228 | +``` |
| 229 | + |
| 230 | +### PR Created |
| 231 | + |
| 232 | +Includes pull request details, there may be more than one pull request if there are multiple repos: |
| 233 | + |
| 234 | +```json |
| 235 | +{ |
| 236 | + "action": "pr_created", |
| 237 | + "actor": { |
| 238 | + "id": "sentry", |
| 239 | + "name": "Sentry", |
| 240 | + "type": "application" |
| 241 | + }, |
| 242 | + "data": { |
| 243 | + "run_id": 12345, |
| 244 | + "group_id": 1170820242, |
| 245 | + "pull_requests": [ |
| 246 | + { |
| 247 | + "pull_request": { |
| 248 | + "pr_number": 123, |
| 249 | + "pr_url": "https://github.com/owner/repo/pull/123", |
| 250 | + "pr_id": 456789 |
| 251 | + }, |
| 252 | + "repo_name": "my-app", |
| 253 | + "provider": "github" |
| 254 | + } |
| 255 | + ] |
| 256 | + }, |
| 257 | + "installation": { |
| 258 | + "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de" |
| 259 | + } |
| 260 | +} |
| 261 | +``` |
| 262 | + |
| 263 | +## Use Cases |
| 264 | + |
| 265 | +Seer webhooks enable you to: |
| 266 | + |
| 267 | +1. **Track Progress**: Monitor the status of Seer Issue Fix in real-time |
| 268 | +2. **Build Notifications**: Send custom notifications when fixes are ready |
| 269 | +3. **Audit Trail**: Maintain a log of all Seer fixes for your issues |
| 270 | +4. **Custom Integrations**: Build custom tools that react to Seer's analysis results |
| 271 | + |
| 272 | +## Best Practices |
| 273 | + |
| 274 | +- Store the `run_id` to correlate related webhook events |
| 275 | +- Use the `group_id` to link webhooks back to the original Sentry issue |
0 commit comments