@sentry/elysia 10.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Functional Software, Inc. dba Sentry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ <p align="center">
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4
+ </a>
5
+ </p>
6
+
7
+ > NOTICE: This package is in alpha state and may be subject to breaking changes.
8
+
9
+ # Official Sentry SDK for Elysia
10
+
11
+ [![npm version](https://img.shields.io/npm/v/@sentry/elysia.svg)](https://www.npmjs.com/package/@sentry/elysia)
12
+ [![npm dm](https://img.shields.io/npm/dm/@sentry/elysia.svg)](https://www.npmjs.com/package/@sentry/elysia)
13
+ [![npm dt](https://img.shields.io/npm/dt/@sentry/elysia.svg)](https://www.npmjs.com/package/@sentry/elysia)
14
+
15
+ > **Alpha**: This SDK is in alpha stage and may have breaking changes in future releases.
16
+
17
+ ## Usage
18
+
19
+ ```javascript
20
+ import * as Sentry from '@sentry/elysia';
21
+ import { Elysia } from 'elysia';
22
+
23
+ Sentry.init({
24
+ dsn: '__DSN__',
25
+ tracesSampleRate: 1.0,
26
+ });
27
+
28
+ const app = Sentry.withElysia(new Elysia())
29
+ .get('/', () => 'Hello World')
30
+ .listen(3000);
31
+ ```
32
+
33
+ ## Links
34
+
35
+ <!-- - [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/elysia/) -->
36
+
37
+ - [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_elysia)
38
+ - [Sentry Discord Server](https://discord.gg/Ww9hbqr)
@@ -0,0 +1,170 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const bun = require('@sentry/bun');
4
+ const core = require('@sentry/core');
5
+ const withElysia = require('./withElysia.js');
6
+ const sdk = require('./sdk.js');
7
+
8
+
9
+
10
+ exports.NodeClient = bun.NodeClient;
11
+ exports.OpenFeatureIntegrationHook = bun.OpenFeatureIntegrationHook;
12
+ exports.SDK_VERSION = bun.SDK_VERSION;
13
+ exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = bun.SEMANTIC_ATTRIBUTE_SENTRY_OP;
14
+ exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = bun.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
15
+ exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = bun.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE;
16
+ exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = bun.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE;
17
+ exports.Scope = bun.Scope;
18
+ exports.addBreadcrumb = bun.addBreadcrumb;
19
+ exports.addEventProcessor = bun.addEventProcessor;
20
+ exports.addIntegration = bun.addIntegration;
21
+ exports.amqplibIntegration = bun.amqplibIntegration;
22
+ exports.anrIntegration = bun.anrIntegration;
23
+ exports.anthropicAIIntegration = bun.anthropicAIIntegration;
24
+ exports.buildLaunchDarklyFlagUsedHandler = bun.buildLaunchDarklyFlagUsedHandler;
25
+ exports.bunServerIntegration = bun.bunServerIntegration;
26
+ exports.captureCheckIn = bun.captureCheckIn;
27
+ exports.captureEvent = bun.captureEvent;
28
+ exports.captureException = bun.captureException;
29
+ exports.captureFeedback = bun.captureFeedback;
30
+ exports.captureMessage = bun.captureMessage;
31
+ exports.captureSession = bun.captureSession;
32
+ exports.close = bun.close;
33
+ exports.connectIntegration = bun.connectIntegration;
34
+ exports.consoleIntegration = bun.consoleIntegration;
35
+ exports.consoleLoggingIntegration = bun.consoleLoggingIntegration;
36
+ exports.contextLinesIntegration = bun.contextLinesIntegration;
37
+ exports.continueTrace = bun.continueTrace;
38
+ exports.createConsolaReporter = bun.createConsolaReporter;
39
+ exports.createGetModuleFromFilename = bun.createGetModuleFromFilename;
40
+ exports.createLangChainCallbackHandler = bun.createLangChainCallbackHandler;
41
+ exports.createSentryWinstonTransport = bun.createSentryWinstonTransport;
42
+ exports.createTransport = bun.createTransport;
43
+ exports.cron = bun.cron;
44
+ exports.dataloaderIntegration = bun.dataloaderIntegration;
45
+ exports.defaultStackParser = bun.defaultStackParser;
46
+ exports.disableAnrDetectionForCallback = bun.disableAnrDetectionForCallback;
47
+ exports.endSession = bun.endSession;
48
+ exports.eventFiltersIntegration = bun.eventFiltersIntegration;
49
+ exports.expressErrorHandler = bun.expressErrorHandler;
50
+ exports.expressIntegration = bun.expressIntegration;
51
+ exports.fastifyIntegration = bun.fastifyIntegration;
52
+ exports.featureFlagsIntegration = bun.featureFlagsIntegration;
53
+ exports.firebaseIntegration = bun.firebaseIntegration;
54
+ exports.flush = bun.flush;
55
+ exports.fsIntegration = bun.fsIntegration;
56
+ exports.functionToStringIntegration = bun.functionToStringIntegration;
57
+ exports.generateInstrumentOnce = bun.generateInstrumentOnce;
58
+ exports.genericPoolIntegration = bun.genericPoolIntegration;
59
+ exports.getActiveSpan = bun.getActiveSpan;
60
+ exports.getAutoPerformanceIntegrations = bun.getAutoPerformanceIntegrations;
61
+ exports.getClient = bun.getClient;
62
+ exports.getCurrentScope = bun.getCurrentScope;
63
+ exports.getGlobalScope = bun.getGlobalScope;
64
+ exports.getIsolationScope = bun.getIsolationScope;
65
+ exports.getRootSpan = bun.getRootSpan;
66
+ exports.getSentryRelease = bun.getSentryRelease;
67
+ exports.getSpanDescendants = bun.getSpanDescendants;
68
+ exports.getSpanStatusFromHttpCode = bun.getSpanStatusFromHttpCode;
69
+ exports.getTraceData = bun.getTraceData;
70
+ exports.getTraceMetaTags = bun.getTraceMetaTags;
71
+ exports.googleGenAIIntegration = bun.googleGenAIIntegration;
72
+ exports.graphqlIntegration = bun.graphqlIntegration;
73
+ exports.growthbookIntegration = bun.growthbookIntegration;
74
+ exports.hapiIntegration = bun.hapiIntegration;
75
+ exports.honoIntegration = bun.honoIntegration;
76
+ exports.httpHeadersToSpanAttributes = bun.httpHeadersToSpanAttributes;
77
+ exports.httpIntegration = bun.httpIntegration;
78
+ exports.httpServerIntegration = bun.httpServerIntegration;
79
+ exports.httpServerSpansIntegration = bun.httpServerSpansIntegration;
80
+ exports.inboundFiltersIntegration = bun.inboundFiltersIntegration;
81
+ exports.initOpenTelemetry = bun.initOpenTelemetry;
82
+ exports.instrumentAnthropicAiClient = bun.instrumentAnthropicAiClient;
83
+ exports.instrumentGoogleGenAIClient = bun.instrumentGoogleGenAIClient;
84
+ exports.instrumentLangGraph = bun.instrumentLangGraph;
85
+ exports.instrumentOpenAiClient = bun.instrumentOpenAiClient;
86
+ exports.instrumentStateGraphCompile = bun.instrumentStateGraphCompile;
87
+ exports.instrumentSupabaseClient = bun.instrumentSupabaseClient;
88
+ exports.isEnabled = bun.isEnabled;
89
+ exports.isInitialized = bun.isInitialized;
90
+ exports.kafkaIntegration = bun.kafkaIntegration;
91
+ exports.knexIntegration = bun.knexIntegration;
92
+ exports.koaIntegration = bun.koaIntegration;
93
+ exports.langChainIntegration = bun.langChainIntegration;
94
+ exports.langGraphIntegration = bun.langGraphIntegration;
95
+ exports.lastEventId = bun.lastEventId;
96
+ exports.launchDarklyIntegration = bun.launchDarklyIntegration;
97
+ exports.linkedErrorsIntegration = bun.linkedErrorsIntegration;
98
+ exports.localVariablesIntegration = bun.localVariablesIntegration;
99
+ exports.logger = bun.logger;
100
+ exports.lruMemoizerIntegration = bun.lruMemoizerIntegration;
101
+ exports.makeFetchTransport = bun.makeFetchTransport;
102
+ exports.makeNodeTransport = bun.makeNodeTransport;
103
+ exports.metrics = bun.metrics;
104
+ exports.modulesIntegration = bun.modulesIntegration;
105
+ exports.mongoIntegration = bun.mongoIntegration;
106
+ exports.mongooseIntegration = bun.mongooseIntegration;
107
+ exports.mysql2Integration = bun.mysql2Integration;
108
+ exports.mysqlIntegration = bun.mysqlIntegration;
109
+ exports.nativeNodeFetchIntegration = bun.nativeNodeFetchIntegration;
110
+ exports.nodeContextIntegration = bun.nodeContextIntegration;
111
+ exports.onUncaughtExceptionIntegration = bun.onUncaughtExceptionIntegration;
112
+ exports.onUnhandledRejectionIntegration = bun.onUnhandledRejectionIntegration;
113
+ exports.openAIIntegration = bun.openAIIntegration;
114
+ exports.openFeatureIntegration = bun.openFeatureIntegration;
115
+ exports.parameterize = bun.parameterize;
116
+ exports.postgresIntegration = bun.postgresIntegration;
117
+ exports.postgresJsIntegration = bun.postgresJsIntegration;
118
+ exports.prismaIntegration = bun.prismaIntegration;
119
+ exports.processSessionIntegration = bun.processSessionIntegration;
120
+ exports.profiler = bun.profiler;
121
+ exports.redisIntegration = bun.redisIntegration;
122
+ exports.requestDataIntegration = bun.requestDataIntegration;
123
+ exports.setContext = bun.setContext;
124
+ exports.setConversationId = bun.setConversationId;
125
+ exports.setCurrentClient = bun.setCurrentClient;
126
+ exports.setExtra = bun.setExtra;
127
+ exports.setExtras = bun.setExtras;
128
+ exports.setHttpStatus = bun.setHttpStatus;
129
+ exports.setMeasurement = bun.setMeasurement;
130
+ exports.setTag = bun.setTag;
131
+ exports.setTags = bun.setTags;
132
+ exports.setUser = bun.setUser;
133
+ exports.setupConnectErrorHandler = bun.setupConnectErrorHandler;
134
+ exports.setupExpressErrorHandler = bun.setupExpressErrorHandler;
135
+ exports.setupFastifyErrorHandler = bun.setupFastifyErrorHandler;
136
+ exports.setupHapiErrorHandler = bun.setupHapiErrorHandler;
137
+ exports.setupHonoErrorHandler = bun.setupHonoErrorHandler;
138
+ exports.setupKoaErrorHandler = bun.setupKoaErrorHandler;
139
+ exports.spanToBaggageHeader = bun.spanToBaggageHeader;
140
+ exports.spanToJSON = bun.spanToJSON;
141
+ exports.spanToTraceHeader = bun.spanToTraceHeader;
142
+ exports.spotlightIntegration = bun.spotlightIntegration;
143
+ exports.startInactiveSpan = bun.startInactiveSpan;
144
+ exports.startNewTrace = bun.startNewTrace;
145
+ exports.startSession = bun.startSession;
146
+ exports.startSpan = bun.startSpan;
147
+ exports.startSpanManual = bun.startSpanManual;
148
+ exports.statsigIntegration = bun.statsigIntegration;
149
+ exports.supabaseIntegration = bun.supabaseIntegration;
150
+ exports.suppressTracing = bun.suppressTracing;
151
+ exports.tediousIntegration = bun.tediousIntegration;
152
+ exports.trpcMiddleware = bun.trpcMiddleware;
153
+ exports.unleashIntegration = bun.unleashIntegration;
154
+ exports.updateSpanName = bun.updateSpanName;
155
+ exports.vercelAIIntegration = bun.vercelAIIntegration;
156
+ exports.winterCGHeadersToDict = bun.winterCGHeadersToDict;
157
+ exports.withActiveSpan = bun.withActiveSpan;
158
+ exports.withIsolationScope = bun.withIsolationScope;
159
+ exports.withMonitor = bun.withMonitor;
160
+ exports.withScope = bun.withScope;
161
+ exports.wrapMcpServerWithSentry = bun.wrapMcpServerWithSentry;
162
+ exports.zodErrorsIntegration = bun.zodErrorsIntegration;
163
+ exports.captureConsoleIntegration = core.captureConsoleIntegration;
164
+ exports.dedupeIntegration = core.dedupeIntegration;
165
+ exports.extraErrorDataIntegration = core.extraErrorDataIntegration;
166
+ exports.rewriteFramesIntegration = core.rewriteFramesIntegration;
167
+ exports.withElysia = withElysia.withElysia;
168
+ exports.getDefaultIntegrations = sdk.getDefaultIntegrations;
169
+ exports.init = sdk.init;
170
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,59 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const os = require('node:os');
4
+ const bun = require('@sentry/bun');
5
+ const core = require('@sentry/core');
6
+
7
+ /** Get the default integrations for the Elysia SDK. */
8
+ function getDefaultIntegrations(_options) {
9
+ // Filter out bunServerIntegration
10
+ // Elysia already produces an HTTP server span, so we don't need Bun's competing root span.
11
+ return bun.getDefaultIntegrations(_options).filter(i => i.name !== bun.bunServerIntegration().name);
12
+ }
13
+
14
+ /**
15
+ * Get the runtime name and version.
16
+ */
17
+ function getRuntime() {
18
+ if (typeof Bun !== 'undefined') {
19
+ return { name: 'bun', version: Bun.version };
20
+ }
21
+
22
+ return { name: 'node', version: process.version };
23
+ }
24
+
25
+ /**
26
+ * Initializes the Sentry Elysia SDK.
27
+ *
28
+ * @example
29
+ * ```javascript
30
+ * import * as Sentry from '@sentry/elysia';
31
+ *
32
+ * Sentry.init({
33
+ * dsn: '__DSN__',
34
+ * tracesSampleRate: 1.0,
35
+ * });
36
+ * ```
37
+ */
38
+ function init(userOptions = {}) {
39
+ const options = {
40
+ ...userOptions,
41
+ platform: 'javascript',
42
+ runtime: getRuntime(),
43
+ serverName: userOptions.serverName || global.process.env.SENTRY_NAME || os.hostname(),
44
+ };
45
+
46
+ core.applySdkMetadata(userOptions, 'elysia', ['elysia', options.runtime.name]);
47
+
48
+ options.transport = options.transport || bun.makeFetchTransport;
49
+
50
+ if (options.defaultIntegrations === undefined) {
51
+ options.defaultIntegrations = getDefaultIntegrations(options);
52
+ }
53
+
54
+ return bun.init(options);
55
+ }
56
+
57
+ exports.getDefaultIntegrations = getDefaultIntegrations;
58
+ exports.init = init;
59
+ //# sourceMappingURL=sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import * as os from 'node:os';\nimport {\n bunServerIntegration,\n getDefaultIntegrations as getBunDefaultIntegrations,\n makeFetchTransport,\n} from '@sentry/bun';\nimport type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport { init as initNode, type NodeClient } from '@sentry/bun';\nimport type { ElysiaOptions } from './types';\n\n/** Get the default integrations for the Elysia SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n // Filter out bunServerIntegration\n // Elysia already produces an HTTP server span, so we don't need Bun's competing root span.\n return getBunDefaultIntegrations(_options).filter(i => i.name !== bunServerIntegration().name);\n}\n\n/**\n * Get the runtime name and version.\n */\nfunction getRuntime(): { name: string; version: string } {\n if (typeof Bun !== 'undefined') {\n return { name: 'bun', version: Bun.version };\n }\n\n return { name: 'node', version: process.version };\n}\n\n/**\n * Initializes the Sentry Elysia SDK.\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/elysia';\n *\n * Sentry.init({\n * dsn: '__DSN__',\n * tracesSampleRate: 1.0,\n * });\n * ```\n */\nexport function init(userOptions: ElysiaOptions = {}): NodeClient | undefined {\n const options = {\n ...userOptions,\n platform: 'javascript',\n runtime: getRuntime(),\n serverName: userOptions.serverName || global.process.env.SENTRY_NAME || os.hostname(),\n };\n\n applySdkMetadata(userOptions, 'elysia', ['elysia', options.runtime.name]);\n\n options.transport = options.transport || makeFetchTransport;\n\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations(options);\n }\n\n return initNode(options);\n}\n"],"names":["getBunDefaultIntegrations","bunServerIntegration","applySdkMetadata","makeFetchTransport","initNode"],"mappings":";;;;;;AAWA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE;AACA;AACA,EAAE,OAAOA,0BAAyB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA,IAAK,CAAC,CAAC,SAASC,wBAAoB,EAAE,CAAC,IAAI,CAAC;AAChG;;AAEA;AACA;AACA;AACA,SAAS,UAAU,GAAsC;AACzD,EAAE,IAAI,OAAO,GAAA,KAAQ,WAAW,EAAE;AAClC,IAAI,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAA,EAAS;AAChD,EAAE;;AAEF,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAA,EAAS;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,WAAW,GAAkB,EAAE,EAA0B;AAC9E,EAAE,MAAM,UAAU;AAClB,IAAI,GAAG,WAAW;AAClB,IAAI,QAAQ,EAAE,YAAY;AAC1B,IAAI,OAAO,EAAE,UAAU,EAAE;AACzB,IAAI,UAAU,EAAE,WAAW,CAAC,UAAA,IAAc,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAA,IAAe,EAAE,CAAC,QAAQ,EAAE;AACzF,GAAG;;AAEH,EAAEC,qBAAgB,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;;AAE3E,EAAE,OAAO,CAAC,SAAA,GAAY,OAAO,CAAC,SAAA,IAAaC,sBAAkB;;AAE7D,EAAE,IAAI,OAAO,CAAC,mBAAA,KAAwB,SAAS,EAAE;AACjD,IAAI,OAAO,CAAC,mBAAA,GAAsB,sBAAsB,CAAC,OAAO,CAAC;AACjE,EAAE;;AAEF,EAAE,OAAOC,QAAQ,CAAC,OAAO,CAAC;AAC1B;;;;;"}
@@ -0,0 +1,299 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ const ELYSIA_ORIGIN = 'auto.http.elysia';
6
+
7
+ /**
8
+ * Map Elysia lifecycle phase names to Sentry span ops.
9
+ */
10
+ const ELYSIA_LIFECYCLE_OP_MAP = {
11
+ Request: 'middleware.elysia',
12
+ Parse: 'middleware.elysia',
13
+ Transform: 'middleware.elysia',
14
+ BeforeHandle: 'middleware.elysia',
15
+ Handle: 'request_handler.elysia',
16
+ AfterHandle: 'middleware.elysia',
17
+ MapResponse: 'middleware.elysia',
18
+ AfterResponse: 'middleware.elysia',
19
+ Error: 'middleware.elysia',
20
+ };
21
+
22
+ function isBun() {
23
+ return typeof Bun !== 'undefined';
24
+ }
25
+
26
+ /**
27
+ * Per-request storage for the root span reference.
28
+ * .wrap() captures the root span and .trace() reads it.
29
+ * This is necessary because Elysia's .trace() callbacks may run in a different
30
+ * async context where getActiveSpan() returns undefined.
31
+ */
32
+ const rootSpanForRequest = new WeakMap();
33
+
34
+ const instrumentedApps = new WeakSet();
35
+
36
+ /**
37
+ * Updates the root span and isolation scope with the parameterized route name.
38
+ */
39
+ function updateRouteTransactionName(request, method, route) {
40
+ const transactionName = `${method} ${route}`;
41
+
42
+ // Try the stored root span first (reliable across async contexts),
43
+ // then fall back to getActiveSpan() for cases where async context is preserved.
44
+ const rootSpan = rootSpanForRequest.get(request);
45
+ if (rootSpan) {
46
+ core.updateSpanName(rootSpan, transactionName);
47
+ rootSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
48
+ } else {
49
+ const activeSpan = core.getActiveSpan();
50
+ if (activeSpan) {
51
+ const root = core.getRootSpan(activeSpan);
52
+ core.updateSpanName(root, transactionName);
53
+ root.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
54
+ }
55
+ }
56
+
57
+ core.getIsolationScope().setTransactionName(transactionName);
58
+ }
59
+
60
+ function defaultShouldHandleError(context) {
61
+ const status = context.set.status;
62
+ if (status === undefined) {
63
+ return true;
64
+ }
65
+ const statusCode = parseInt(String(status), 10);
66
+ if (Number.isNaN(statusCode)) {
67
+ return true;
68
+ }
69
+ // Capture server errors (5xx) and unusual status codes (<= 299 in an error handler).
70
+ // 3xx and 4xx are not captured by default (client errors / redirects).
71
+ return statusCode >= 500 || statusCode <= 299;
72
+ }
73
+
74
+ /**
75
+ * Instruments a single Elysia lifecycle phase by creating a Sentry span for it,
76
+ * and child spans for each individual handler within the phase.
77
+ *
78
+ * @param rootSpan - The root server span to parent lifecycle spans under.
79
+ * Must be passed explicitly because Elysia's .trace() listener callbacks run
80
+ * in a different async context where getActiveSpan() returns undefined.
81
+ */
82
+ function instrumentLifecyclePhase(phaseName, listener, rootSpan) {
83
+ const op = ELYSIA_LIFECYCLE_OP_MAP[phaseName];
84
+ if (!op) {
85
+ return;
86
+ }
87
+
88
+ void listener(process => {
89
+ const phaseSpan = core.startInactiveSpan({
90
+ name: phaseName,
91
+ parentSpan: rootSpan,
92
+ attributes: {
93
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,
94
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ELYSIA_ORIGIN,
95
+ },
96
+ });
97
+
98
+ // Create child spans for individual handlers within this phase.
99
+ // Named functions get their name, arrow functions get 'anonymous'.
100
+ if (process.total > 0) {
101
+ void process.onEvent(child => {
102
+ const handlerName = child.name || 'anonymous';
103
+ const childSpan = core.startInactiveSpan({
104
+ name: handlerName,
105
+ parentSpan: phaseSpan,
106
+ attributes: {
107
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,
108
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ELYSIA_ORIGIN,
109
+ },
110
+ });
111
+
112
+ void child.onStop(() => {
113
+ childSpan.end();
114
+ });
115
+ });
116
+ }
117
+
118
+ void process.onStop(() => {
119
+ phaseSpan.end();
120
+ });
121
+ });
122
+ }
123
+
124
+ /**
125
+ * Integrate Sentry with an Elysia app for error handling, request context,
126
+ * and tracing. Returns the app instance for chaining.
127
+ *
128
+ * Should be called at the **start** of the chain before defining routes.
129
+ *
130
+ * @param app The Elysia instance
131
+ * @param options Configuration options
132
+ * @returns The same Elysia instance for chaining
133
+ *
134
+ * @example
135
+ * ```javascript
136
+ * import * as Sentry from '@sentry/elysia';
137
+ * import { Elysia } from 'elysia';
138
+ *
139
+ * Sentry.withElysia(new Elysia())
140
+ * .get('/', () => 'Hello World')
141
+ * .listen(3000);
142
+ * ```
143
+ */
144
+ function withElysia(app, options = {}) {
145
+ if (instrumentedApps.has(app)) {
146
+ return app;
147
+ }
148
+ instrumentedApps.add(app);
149
+
150
+ // Use .wrap() to capture or create the root span for each request.
151
+ // This is necessary because Elysia's .trace() callbacks run in a different
152
+ // async context where getActiveSpan() returns undefined. By storing the root
153
+ // span in a WeakMap keyed by the Request object, we can retrieve it in .trace().
154
+ // HigherOrderFunction type is not exported from elysia's main entry point,
155
+ // so we type the callback parameters directly.
156
+ app.wrap((fn, request) => {
157
+ if (isBun()) {
158
+ // On Bun there is no HTTP instrumentation, so we create a root span ourselves.
159
+ // Scope setup must happen inside the returned function so that it's active
160
+ // when Elysia calls the handler (not during .wrap() registration).
161
+ return (...args) => {
162
+ return core.withIsolationScope(() => {
163
+ return core.continueTrace(
164
+ {
165
+ sentryTrace: request.headers.get('sentry-trace') || '',
166
+ baggage: request.headers.get('baggage'),
167
+ },
168
+ () => {
169
+ return core.startSpanManual(
170
+ {
171
+ op: 'http.server',
172
+ name: `${request.method} ${new URL(request.url).pathname}`,
173
+ attributes: {
174
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ELYSIA_ORIGIN,
175
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
176
+ },
177
+ },
178
+ rootSpan => {
179
+ rootSpanForRequest.set(request, rootSpan);
180
+ try {
181
+ const result = fn(...args);
182
+ if (result instanceof Promise) {
183
+ return result.then(
184
+ res => {
185
+ rootSpanForRequest.delete(request);
186
+ rootSpan.end();
187
+ return res;
188
+ },
189
+ err => {
190
+ rootSpanForRequest.delete(request);
191
+ rootSpan.end();
192
+ throw err;
193
+ },
194
+ );
195
+ }
196
+ rootSpanForRequest.delete(request);
197
+ rootSpan.end();
198
+ return result;
199
+ } catch (err) {
200
+ rootSpanForRequest.delete(request);
201
+ rootSpan.end();
202
+ throw err;
203
+ }
204
+ },
205
+ );
206
+ },
207
+ );
208
+ });
209
+ };
210
+ }
211
+
212
+ // On Node.js, the HTTP instrumentation already creates a root span.
213
+ // We just capture its reference so .trace() can use it.
214
+ const activeSpan = core.getActiveSpan();
215
+ if (activeSpan) {
216
+ rootSpanForRequest.set(request, core.getRootSpan(activeSpan));
217
+ }
218
+ return fn;
219
+ });
220
+
221
+ // Use .trace() ONLY for span creation. The trace API is observational —
222
+ // callbacks fire after phases complete, so they can't reliably mutate
223
+ // response headers or capture errors. All SDK logic stays in real hooks.
224
+ const traceHandler = lifecycle => {
225
+ const rootSpan = rootSpanForRequest.get(lifecycle.context.request);
226
+
227
+ const phases = [
228
+ ['Request', lifecycle.onRequest],
229
+ ['Parse', lifecycle.onParse],
230
+ ['Transform', lifecycle.onTransform],
231
+ ['BeforeHandle', lifecycle.onBeforeHandle],
232
+ ['Handle', lifecycle.onHandle],
233
+ ['AfterHandle', lifecycle.onAfterHandle],
234
+ ['MapResponse', lifecycle.onMapResponse],
235
+ ['AfterResponse', lifecycle.onAfterResponse],
236
+ ['Error', lifecycle.onError],
237
+ ];
238
+
239
+ for (const [phaseName, listener] of phases) {
240
+ if (listener) {
241
+ instrumentLifecyclePhase(phaseName, listener, rootSpan);
242
+ }
243
+ }
244
+ };
245
+
246
+ app.trace({ as: 'global' }, traceHandler);
247
+
248
+ // SDK logic uses real lifecycle hooks — these show up as handler spans
249
+ // in the trace (named sentryOnRequest etc.), but that's the correct
250
+ // tradeoff: the trace API can't reliably mutate state or capture errors.
251
+
252
+ app.onRequest(function sentryOnRequest(context) {
253
+ core.getIsolationScope().setSDKProcessingMetadata({
254
+ normalizedRequest: core.winterCGRequestToRequestData(context.request),
255
+ });
256
+ });
257
+
258
+ app.onAfterHandle({ as: 'global' }, function sentryOnAfterHandle(context) {
259
+ if (context.route) {
260
+ updateRouteTransactionName(context.request, context.request.method, context.route);
261
+ }
262
+
263
+ const traceData = core.getTraceData();
264
+ if (traceData['sentry-trace']) {
265
+ context.set.headers['sentry-trace'] = traceData['sentry-trace'];
266
+ }
267
+ if (traceData.baggage) {
268
+ context.set.headers['baggage'] = traceData.baggage;
269
+ }
270
+ });
271
+
272
+ app.onError({ as: 'global' }, function sentryOnError(context) {
273
+ if (context.route) {
274
+ updateRouteTransactionName(context.request, context.request.method, context.route);
275
+ }
276
+
277
+ // Set error status on root span
278
+ const rootSpan = rootSpanForRequest.get(context.request);
279
+ if (rootSpan) {
280
+ const statusCode = parseInt(String(context.set.status), 10);
281
+ core.setHttpStatus(rootSpan, Number.isNaN(statusCode) ? 500 : statusCode);
282
+ }
283
+
284
+ const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;
285
+ if (shouldHandleError(context)) {
286
+ core.captureException(context.error, {
287
+ mechanism: {
288
+ type: 'auto.http.elysia.on_error',
289
+ handled: false,
290
+ },
291
+ });
292
+ }
293
+ });
294
+
295
+ return app;
296
+ }
297
+
298
+ exports.withElysia = withElysia;
299
+ //# sourceMappingURL=withElysia.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withElysia.js","sources":["../../src/withElysia.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport {\n captureException,\n continueTrace,\n getActiveSpan,\n getIsolationScope,\n getRootSpan,\n getTraceData,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n setHttpStatus,\n startInactiveSpan,\n startSpanManual,\n updateSpanName,\n winterCGRequestToRequestData,\n withIsolationScope,\n} from '@sentry/core';\nimport type { Elysia, ErrorContext, TraceHandler, TraceListener } from 'elysia';\n\ninterface ElysiaHandlerOptions {\n shouldHandleError?: (context: ErrorContext) => boolean;\n}\n\nconst ELYSIA_ORIGIN = 'auto.http.elysia';\n\n/**\n * Map Elysia lifecycle phase names to Sentry span ops.\n */\nconst ELYSIA_LIFECYCLE_OP_MAP: Record<string, string> = {\n Request: 'middleware.elysia',\n Parse: 'middleware.elysia',\n Transform: 'middleware.elysia',\n BeforeHandle: 'middleware.elysia',\n Handle: 'request_handler.elysia',\n AfterHandle: 'middleware.elysia',\n MapResponse: 'middleware.elysia',\n AfterResponse: 'middleware.elysia',\n Error: 'middleware.elysia',\n};\n\nfunction isBun(): boolean {\n return typeof Bun !== 'undefined';\n}\n\n/**\n * Per-request storage for the root span reference.\n * .wrap() captures the root span and .trace() reads it.\n * This is necessary because Elysia's .trace() callbacks may run in a different\n * async context where getActiveSpan() returns undefined.\n */\nconst rootSpanForRequest = new WeakMap<Request, Span>();\n\nconst instrumentedApps = new WeakSet<Elysia>();\n\n/**\n * Updates the root span and isolation scope with the parameterized route name.\n */\nfunction updateRouteTransactionName(request: Request, method: string, route: string): void {\n const transactionName = `${method} ${route}`;\n\n // Try the stored root span first (reliable across async contexts),\n // then fall back to getActiveSpan() for cases where async context is preserved.\n const rootSpan = rootSpanForRequest.get(request);\n if (rootSpan) {\n updateSpanName(rootSpan, transactionName);\n rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n } else {\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n const root = getRootSpan(activeSpan);\n updateSpanName(root, transactionName);\n root.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n }\n }\n\n getIsolationScope().setTransactionName(transactionName);\n}\n\nfunction defaultShouldHandleError(context: ErrorContext): boolean {\n const status = context.set.status;\n if (status === undefined) {\n return true;\n }\n const statusCode = parseInt(String(status), 10);\n if (Number.isNaN(statusCode)) {\n return true;\n }\n // Capture server errors (5xx) and unusual status codes (<= 299 in an error handler).\n // 3xx and 4xx are not captured by default (client errors / redirects).\n return statusCode >= 500 || statusCode <= 299;\n}\n\n/**\n * Instruments a single Elysia lifecycle phase by creating a Sentry span for it,\n * and child spans for each individual handler within the phase.\n *\n * @param rootSpan - The root server span to parent lifecycle spans under.\n * Must be passed explicitly because Elysia's .trace() listener callbacks run\n * in a different async context where getActiveSpan() returns undefined.\n */\nfunction instrumentLifecyclePhase(phaseName: string, listener: TraceListener, rootSpan: Span | undefined): void {\n const op = ELYSIA_LIFECYCLE_OP_MAP[phaseName];\n if (!op) {\n return;\n }\n\n void listener(process => {\n const phaseSpan = startInactiveSpan({\n name: phaseName,\n parentSpan: rootSpan,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ELYSIA_ORIGIN,\n },\n });\n\n // Create child spans for individual handlers within this phase.\n // Named functions get their name, arrow functions get 'anonymous'.\n if (process.total > 0) {\n void process.onEvent(child => {\n const handlerName = child.name || 'anonymous';\n const childSpan = startInactiveSpan({\n name: handlerName,\n parentSpan: phaseSpan,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ELYSIA_ORIGIN,\n },\n });\n\n void child.onStop(() => {\n childSpan.end();\n });\n });\n }\n\n void process.onStop(() => {\n phaseSpan.end();\n });\n });\n}\n\n/**\n * Integrate Sentry with an Elysia app for error handling, request context,\n * and tracing. Returns the app instance for chaining.\n *\n * Should be called at the **start** of the chain before defining routes.\n *\n * @param app The Elysia instance\n * @param options Configuration options\n * @returns The same Elysia instance for chaining\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/elysia';\n * import { Elysia } from 'elysia';\n *\n * Sentry.withElysia(new Elysia())\n * .get('/', () => 'Hello World')\n * .listen(3000);\n * ```\n */\nexport function withElysia<T extends Elysia>(app: T, options: ElysiaHandlerOptions = {}): T {\n if (instrumentedApps.has(app)) {\n return app;\n }\n instrumentedApps.add(app);\n\n // Use .wrap() to capture or create the root span for each request.\n // This is necessary because Elysia's .trace() callbacks run in a different\n // async context where getActiveSpan() returns undefined. By storing the root\n // span in a WeakMap keyed by the Request object, we can retrieve it in .trace().\n // HigherOrderFunction type is not exported from elysia's main entry point,\n // so we type the callback parameters directly.\n app.wrap((fn: (...args: unknown[]) => unknown, request: Request) => {\n if (isBun()) {\n // On Bun there is no HTTP instrumentation, so we create a root span ourselves.\n // Scope setup must happen inside the returned function so that it's active\n // when Elysia calls the handler (not during .wrap() registration).\n return (...args: unknown[]) => {\n return withIsolationScope(() => {\n return continueTrace(\n {\n sentryTrace: request.headers.get('sentry-trace') || '',\n baggage: request.headers.get('baggage'),\n },\n () => {\n return startSpanManual(\n {\n op: 'http.server',\n name: `${request.method} ${new URL(request.url).pathname}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ELYSIA_ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n },\n rootSpan => {\n rootSpanForRequest.set(request, rootSpan);\n try {\n const result = fn(...args);\n if (result instanceof Promise) {\n return result.then(\n res => {\n rootSpanForRequest.delete(request);\n rootSpan.end();\n return res;\n },\n err => {\n rootSpanForRequest.delete(request);\n rootSpan.end();\n throw err;\n },\n );\n }\n rootSpanForRequest.delete(request);\n rootSpan.end();\n return result;\n } catch (err) {\n rootSpanForRequest.delete(request);\n rootSpan.end();\n throw err;\n }\n },\n );\n },\n );\n });\n };\n }\n\n // On Node.js, the HTTP instrumentation already creates a root span.\n // We just capture its reference so .trace() can use it.\n const activeSpan = getActiveSpan();\n if (activeSpan) {\n rootSpanForRequest.set(request, getRootSpan(activeSpan));\n }\n return fn;\n });\n\n // Use .trace() ONLY for span creation. The trace API is observational —\n // callbacks fire after phases complete, so they can't reliably mutate\n // response headers or capture errors. All SDK logic stays in real hooks.\n const traceHandler: TraceHandler = lifecycle => {\n const rootSpan = rootSpanForRequest.get(lifecycle.context.request);\n\n const phases: [string, TraceListener][] = [\n ['Request', lifecycle.onRequest],\n ['Parse', lifecycle.onParse],\n ['Transform', lifecycle.onTransform],\n ['BeforeHandle', lifecycle.onBeforeHandle],\n ['Handle', lifecycle.onHandle],\n ['AfterHandle', lifecycle.onAfterHandle],\n ['MapResponse', lifecycle.onMapResponse],\n ['AfterResponse', lifecycle.onAfterResponse],\n ['Error', lifecycle.onError],\n ];\n\n for (const [phaseName, listener] of phases) {\n if (listener) {\n instrumentLifecyclePhase(phaseName, listener, rootSpan);\n }\n }\n };\n\n app.trace({ as: 'global' }, traceHandler);\n\n // SDK logic uses real lifecycle hooks — these show up as handler spans\n // in the trace (named sentryOnRequest etc.), but that's the correct\n // tradeoff: the trace API can't reliably mutate state or capture errors.\n\n app.onRequest(function sentryOnRequest(context) {\n getIsolationScope().setSDKProcessingMetadata({\n normalizedRequest: winterCGRequestToRequestData(context.request),\n });\n });\n\n app.onAfterHandle({ as: 'global' }, function sentryOnAfterHandle(context) {\n if (context.route) {\n updateRouteTransactionName(context.request, context.request.method, context.route);\n }\n\n const traceData = getTraceData();\n if (traceData['sentry-trace']) {\n context.set.headers['sentry-trace'] = traceData['sentry-trace'];\n }\n if (traceData.baggage) {\n context.set.headers['baggage'] = traceData.baggage;\n }\n });\n\n app.onError({ as: 'global' }, function sentryOnError(context) {\n if (context.route) {\n updateRouteTransactionName(context.request, context.request.method, context.route);\n }\n\n // Set error status on root span\n const rootSpan = rootSpanForRequest.get(context.request);\n if (rootSpan) {\n const statusCode = parseInt(String(context.set.status), 10);\n setHttpStatus(rootSpan, Number.isNaN(statusCode) ? 500 : statusCode);\n }\n\n const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;\n if (shouldHandleError(context)) {\n captureException(context.error, {\n mechanism: {\n type: 'auto.http.elysia.on_error',\n handled: false,\n },\n });\n }\n });\n\n return app;\n}\n"],"names":["updateSpanName","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","getActiveSpan","getRootSpan","getIsolationScope","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","withIsolationScope","continueTrace","startSpanManual","winterCGRequestToRequestData","getTraceData","setHttpStatus","captureException"],"mappings":";;;;AAwBA,MAAM,aAAA,GAAgB,kBAAkB;;AAExC;AACA;AACA;AACA,MAAM,uBAAuB,GAA2B;AACxD,EAAE,OAAO,EAAE,mBAAmB;AAC9B,EAAE,KAAK,EAAE,mBAAmB;AAC5B,EAAE,SAAS,EAAE,mBAAmB;AAChC,EAAE,YAAY,EAAE,mBAAmB;AACnC,EAAE,MAAM,EAAE,wBAAwB;AAClC,EAAE,WAAW,EAAE,mBAAmB;AAClC,EAAE,WAAW,EAAE,mBAAmB;AAClC,EAAE,aAAa,EAAE,mBAAmB;AACpC,EAAE,KAAK,EAAE,mBAAmB;AAC5B,CAAC;;AAED,SAAS,KAAK,GAAY;AAC1B,EAAE,OAAO,OAAO,GAAA,KAAQ,WAAW;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAA,GAAqB,IAAI,OAAO,EAAiB;;AAEvD,MAAM,gBAAA,GAAmB,IAAI,OAAO,EAAU;;AAE9C;AACA;AACA;AACA,SAAS,0BAA0B,CAAC,OAAO,EAAW,MAAM,EAAU,KAAK,EAAgB;AAC3F,EAAE,MAAM,eAAA,GAAkB,CAAC,EAAA,MAAA,CAAA,CAAA,EAA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amqplibIntegration, anrIntegration, anthropicAIIntegration, buildLaunchDarklyFlagUsedHandler, bunServerIntegration, captureCheckIn, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, connectIntegration, consoleIntegration, consoleLoggingIntegration, contextLinesIntegration, continueTrace, createConsolaReporter, createGetModuleFromFilename, createLangChainCallbackHandler, createSentryWinstonTransport, createTransport, cron, dataloaderIntegration, defaultStackParser, disableAnrDetectionForCallback, endSession, eventFiltersIntegration, expressErrorHandler, expressIntegration, fastifyIntegration, featureFlagsIntegration, firebaseIntegration, flush, fsIntegration, functionToStringIntegration, generateInstrumentOnce, genericPoolIntegration, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, googleGenAIIntegration, graphqlIntegration, growthbookIntegration, hapiIntegration, honoIntegration, httpHeadersToSpanAttributes, httpIntegration, httpServerIntegration, httpServerSpansIntegration, inboundFiltersIntegration, initOpenTelemetry, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentLangGraph, instrumentOpenAiClient, instrumentStateGraphCompile, instrumentSupabaseClient, isEnabled, isInitialized, kafkaIntegration, knexIntegration, koaIntegration, langChainIntegration, langGraphIntegration, lastEventId, launchDarklyIntegration, linkedErrorsIntegration, localVariablesIntegration, logger, lruMemoizerIntegration, makeFetchTransport, makeNodeTransport, metrics, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nodeContextIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, openFeatureIntegration, parameterize, postgresIntegration, postgresJsIntegration, prismaIntegration, processSessionIntegration, profiler, redisIntegration, requestDataIntegration, setContext, setConversationId, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, setupConnectErrorHandler, setupExpressErrorHandler, setupFastifyErrorHandler, setupHapiErrorHandler, setupHonoErrorHandler, setupKoaErrorHandler, spanToBaggageHeader, spanToJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, statsigIntegration, supabaseIntegration, suppressTracing, tediousIntegration, trpcMiddleware, unleashIntegration, updateSpanName, vercelAIIntegration, winterCGHeadersToDict, withActiveSpan, withIsolationScope, withMonitor, withScope, wrapMcpServerWithSentry, zodErrorsIntegration } from '@sentry/bun';
2
+ export { captureConsoleIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration } from '@sentry/core';
3
+ export { withElysia } from './withElysia.js';
4
+ export { getDefaultIntegrations, init } from './sdk.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1 @@
1
+ {"type":"module","version":"10.46.0","sideEffects":false}