chore: Add tags to sentry's event loop blocked integration (#19126)

This commit is contained in:
Tomi Turtiainen
2025-09-03 11:57:18 +03:00
committed by GitHub
parent 89fc91bed6
commit a82e3c8ede

View File

@@ -132,7 +132,12 @@ export class ErrorReporter {
];
const eventLoopBlockIntegration = withEventLoopBlockDetection
? await this.getEventLoopBlockIntegration()
? // The EventLoopBlockIntegration doesn't automatically include the
// same tags, so we set them explicitly.
await this.getEventLoopBlockIntegration({
server_name: serverName,
server_type: serverType,
})
: [];
init({
@@ -262,10 +267,14 @@ export class ErrorReporter {
if (tags) event.tags = { ...event.tags, ...tags };
}
private async getEventLoopBlockIntegration() {
private async getEventLoopBlockIntegration(tags: Record<string, string>) {
try {
const { eventLoopBlockIntegration } = await import('@sentry/node-native');
return [eventLoopBlockIntegration()];
return [
eventLoopBlockIntegration({
staticTags: tags,
}),
];
} catch {
this.logger.debug(
"Sentry's event loop block integration is disabled, because the native binary for `@sentry/node-native` was not found",