mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Tag migrations-worker Sentry events with source projectId and endpoint
When a publishable exception bubbles to Sentry from the migrations worker, include the source projectId and endpoint in the event extras so on-call can correlate the event with the failing migration without a round-trip to the database. Only emitted for Appwrite-source migrations because the credentials shape varies by source type; the apiKey is never included.
This commit is contained in:
@@ -577,11 +577,21 @@ class Migrations extends Action
|
||||
}
|
||||
|
||||
if ($publish) {
|
||||
call_user_func($this->logError, $th, 'appwrite-worker', 'appwrite-queue-' . self::getName(), [
|
||||
$extras = [
|
||||
'migrationId' => $migration->getId(),
|
||||
'source' => $migration->getAttribute('source') ?? '',
|
||||
'destination' => $migration->getAttribute('destination') ?? '',
|
||||
]);
|
||||
];
|
||||
|
||||
// Include source identifiers for Appwrite sources to make Sentry events
|
||||
// self-debuggable. Never include the apiKey or any other secret.
|
||||
if ($migration->getAttribute('source') === SourceAppwrite::getName()) {
|
||||
$credentials = $migration->getAttribute('credentials', []) ?? [];
|
||||
$extras['sourceProjectId'] = $credentials['projectId'] ?? '';
|
||||
$extras['sourceEndpoint'] = $credentials['endpoint'] ?? '';
|
||||
}
|
||||
|
||||
call_user_func($this->logError, $th, 'appwrite-worker', 'appwrite-queue-' . self::getName(), $extras);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user