diff --git a/packages/deno/src/client.ts b/packages/deno/src/client.ts index 8dbbd144f9c7..20207bdc0074 100644 --- a/packages/deno/src/client.ts +++ b/packages/deno/src/client.ts @@ -1,3 +1,4 @@ +import { SERVER_ADDRESS } from '@sentry/conventions/attributes'; import type { ServerRuntimeClientOptions } from '@sentry/core/server'; import { SDK_VERSION } from '@sentry/core'; import { ServerRuntimeClient } from '@sentry/core/server'; @@ -65,7 +66,7 @@ export class DenoClient extends ServerRuntimeClient { this.on('beforeCaptureLog', log => { log.attributes = { ...log.attributes, - 'server.address': serverName, + [SERVER_ADDRESS]: serverName, }; }); } diff --git a/packages/deno/src/integrations/context.ts b/packages/deno/src/integrations/context.ts index 8adf1d7dce73..d08362250b58 100644 --- a/packages/deno/src/integrations/context.ts +++ b/packages/deno/src/integrations/context.ts @@ -1,3 +1,12 @@ +import { + APP_START_TIME, + DEVICE_ARCHS, + DEVICE_PROCESSOR_COUNT, + OS_NAME, + OS_VERSION, + PROCESS_RUNTIME_ENGINE_NAME, + PROCESS_RUNTIME_ENGINE_VERSION, +} from '@sentry/conventions/attributes'; import type { IntegrationFn } from '@sentry/core'; import { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core'; @@ -40,20 +49,20 @@ const _denoContextIntegration = (() => { }; const cachedSpanAttributes: Record = { - 'app.start_time': appStartTime, + [APP_START_TIME]: appStartTime, // Convention uses 'device.archs' (string[]), but array attributes are not yet serialized. // Once array serialization lands, this will start appearing on spans automatically. - 'device.archs': [arch], - 'device.processor_count': processorCount, - 'os.name': osName, - 'process.runtime.engine.name': 'v8', - 'process.runtime.engine.version': v8Version, + [DEVICE_ARCHS]: [arch], + [DEVICE_PROCESSOR_COUNT]: processorCount, + [OS_NAME]: osName, + [PROCESS_RUNTIME_ENGINE_NAME]: 'v8', + [PROCESS_RUNTIME_ENGINE_VERSION]: v8Version, }; getOSRelease() .then(release => { cachedContext.os.version = release; - cachedSpanAttributes['os.version'] = release; + cachedSpanAttributes[OS_VERSION] = release; }) .catch(() => { // Ignore - os.version will be undefined diff --git a/packages/deno/src/integrations/denoRuntimeMetrics.ts b/packages/deno/src/integrations/denoRuntimeMetrics.ts index 0a0382e067b9..d697e898c9be 100644 --- a/packages/deno/src/integrations/denoRuntimeMetrics.ts +++ b/packages/deno/src/integrations/denoRuntimeMetrics.ts @@ -1,3 +1,4 @@ +import { SENTRY_ORIGIN } from '@sentry/conventions/attributes'; import { _INTERNAL_safeDateNow, defineIntegration, metrics } from '@sentry/core'; const INTEGRATION_NAME = 'DenoRuntimeMetrics' as const; @@ -79,8 +80,8 @@ export const denoRuntimeMetricsIntegration = defineIntegration((options: DenoRun let intervalId: number | undefined; let prevFlushTime: number = 0; - const METRIC_ATTRIBUTES_BYTE = { unit: 'byte', attributes: { 'sentry.origin': 'auto.deno.runtime_metrics' } }; - const METRIC_ATTRIBUTES_SECOND = { unit: 'second', attributes: { 'sentry.origin': 'auto.deno.runtime_metrics' } }; + const METRIC_ATTRIBUTES_BYTE = { unit: 'byte', attributes: { [SENTRY_ORIGIN]: 'auto.deno.runtime_metrics' } }; + const METRIC_ATTRIBUTES_SECOND = { unit: 'second', attributes: { [SENTRY_ORIGIN]: 'auto.deno.runtime_metrics' } }; function collectMetrics(): void { const now = _INTERNAL_safeDateNow();