Skip to content

Commit 6b6ddd2

Browse files
authored
fix: sentry node instrumentation version support + sdk double patching issue (#158)
* fix: update supported versions * fix: only specify instrumentations if programmaticImports is disabled * feat: export handlers + disable before patch * docs: add changesets * style: remove unused imports
1 parent 73a7d84 commit 6b6ddd2

6 files changed

Lines changed: 18 additions & 5 deletions

File tree

.changeset/dirty-houses-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hyperdx/node-opentelemetry': patch
3+
---
4+
5+
fix: sdk double patching issue

.changeset/hot-bananas-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hyperdx/instrumentation-sentry-node': patch
3+
---
4+
5+
fix: sentry node instrumentation version support

packages/instrumentation-sentry-node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ npm install --save @hyperdx/instrumentation-sentry-node
1515

1616
### Supported Versions
1717

18-
- `>=7 <9`
18+
- `>=7.30.0 <9`
1919

2020
## Usage
2121

packages/instrumentation-sentry-node/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class SentryNodeInstrumentation extends InstrumentationBase {
2727
return [
2828
new InstrumentationNodeModuleDefinition(
2929
'@sentry/node',
30-
['^7.0.0', '^8.0.0'],
30+
['>=7.30.0 <9'],
3131
(moduleExports: typeof Sentry) => {
3232
diag.debug(
3333
`Detected Sentry installed with SDK version: ${moduleExports.SDK_VERSION}`,
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
export * from './gcp';
22
export * from './logger';
33
export * from './otel';
4-
export { recordException } from '@hyperdx/instrumentation-exception';
4+
export {
5+
recordException,
6+
setupExpressErrorHandler,
7+
setupKoaErrorHandler,
8+
} from '@hyperdx/instrumentation-exception';

packages/node-opentelemetry/src/otel.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { RuntimeNodeInstrumentation } from '@opentelemetry/instrumentation-runti
1111
import { SentryNodeInstrumentation } from '@hyperdx/instrumentation-sentry-node';
1212
import {
1313
InstrumentationBase,
14-
Instrumentation,
1514
InstrumentationModuleDefinition,
1615
} from '@opentelemetry/instrumentation';
1716
import { NodeSDK } from '@opentelemetry/sdk-node';
@@ -350,7 +349,7 @@ export const initSDK = (config: SDKConfig) => {
350349
}),
351350
]),
352351
],
353-
instrumentations: allInstrumentations,
352+
instrumentations: config.programmaticImports ? [] : allInstrumentations,
354353
contextManager: contextManager,
355354
});
356355

0 commit comments

Comments
 (0)