From ab0c8ce98385a0ee9ce6f8e35deac3af852f32e2 Mon Sep 17 00:00:00 2001 From: Martin Sonnberger Date: Tue, 27 Oct 2026 15:53:25 +0100 Subject: [PATCH] refactor(bun): Use convention constants for attribute keys Co-Authored-By: GPT-6 --- packages/bun/src/integrations/bunRuntimeMetrics.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/bun/src/integrations/bunRuntimeMetrics.ts b/packages/bun/src/integrations/bunRuntimeMetrics.ts index beb079473b99..9be65ffd3b9e 100644 --- a/packages/bun/src/integrations/bunRuntimeMetrics.ts +++ b/packages/bun/src/integrations/bunRuntimeMetrics.ts @@ -1,3 +1,4 @@ +import { SENTRY_ORIGIN } from '@sentry/conventions/attributes'; import { performance } from 'perf_hooks'; import { _INTERNAL_safeDateNow, defineIntegration, metrics } from '@sentry/core'; import { _INTERNAL_safeUnref } from '@sentry/core/server'; @@ -92,9 +93,9 @@ export const bunRuntimeMetricsIntegration = defineIntegration((options: BunRunti let prevFlushTime: number = 0; let eluAvailable = false; - const METRIC_ATTRIBUTES = { attributes: { 'sentry.origin': 'auto.bun.runtime_metrics' } }; - const METRIC_ATTRIBUTES_BYTE = { unit: 'byte', attributes: { 'sentry.origin': 'auto.bun.runtime_metrics' } }; - const METRIC_ATTRIBUTES_SECOND = { unit: 'second', attributes: { 'sentry.origin': 'auto.bun.runtime_metrics' } }; + const METRIC_ATTRIBUTES = { attributes: { [SENTRY_ORIGIN]: 'auto.bun.runtime_metrics' } }; + const METRIC_ATTRIBUTES_BYTE = { unit: 'byte', attributes: { [SENTRY_ORIGIN]: 'auto.bun.runtime_metrics' } }; + const METRIC_ATTRIBUTES_SECOND = { unit: 'second', attributes: { [SENTRY_ORIGIN]: 'auto.bun.runtime_metrics' } }; function collectMetrics(): void { const now = _INTERNAL_safeDateNow();