Skip to content

Commit 723b598

Browse files
sergicalclaude
andcommitted
feat(deno): Export metrics API from Deno SDK
The metrics namespace is already exported from @sentry/core and re-exported by @sentry/node, but was missing from the Deno SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e5b19a6 commit 723b598

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/deno/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export {
8989
updateSpanName,
9090
wrapMcpServerWithSentry,
9191
featureFlagsIntegration,
92+
metrics,
9293
} from '@sentry/core';
9394

9495
export { DenoClient } from './client';

packages/deno/test/mod.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Event } from '@sentry/core';
22
import { createStackParser, nodeStackLineParser } from '@sentry/core';
33
import { assertEquals } from 'https://deno.land/std@0.202.0/assert/assert_equals.ts';
44
import { assertSnapshot } from 'https://deno.land/std@0.202.0/testing/snapshot.ts';
5-
import { DenoClient, getCurrentScope, getDefaultIntegrations } from '../build/esm/index.js';
5+
import { DenoClient, getCurrentScope, getDefaultIntegrations, metrics } from '../build/esm/index.js';
66
import { getNormalizedEvent } from './normalize.ts';
77
import { makeTestTransport } from './transport.ts';
88

@@ -74,6 +74,12 @@ Deno.test('captureMessage twice', async t => {
7474
await assertSnapshot(t, ev);
7575
});
7676

77+
Deno.test('metrics API is exported', () => {
78+
assertEquals(typeof metrics.count, 'function');
79+
assertEquals(typeof metrics.gauge, 'function');
80+
assertEquals(typeof metrics.distribution, 'function');
81+
});
82+
7783
Deno.test('App runs without errors', async _ => {
7884
const cmd = new Deno.Command('deno', {
7985
args: ['run', '--allow-net=some-domain.com', './test/example.ts'],

0 commit comments

Comments
 (0)