Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/deno/src/client.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -65,7 +66,7 @@ export class DenoClient extends ServerRuntimeClient<DenoClientOptions> {
this.on('beforeCaptureLog', log => {
log.attributes = {
...log.attributes,
'server.address': serverName,
[SERVER_ADDRESS]: serverName,
};
});
}
Expand Down
23 changes: 16 additions & 7 deletions packages/deno/src/integrations/context.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -40,20 +49,20 @@ const _denoContextIntegration = (() => {
};

const cachedSpanAttributes: Record<string, unknown> = {
'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
Expand Down
5 changes: 3 additions & 2 deletions packages/deno/src/integrations/denoRuntimeMetrics.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Loading