Skip to content

Commit 67dc745

Browse files
committed
Use SDK_VERSION for http and fetch instrumentation version
1 parent 3bcf0b2 commit 67dc745

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/node-core/src/integrations/http/SentryHttpInstrumentation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type * as http from 'node:http';
55
import type * as https from 'node:https';
66
import type { EventEmitter } from 'node:stream';
77
import { context, propagation } from '@opentelemetry/api';
8-
import { isTracingSuppressed, VERSION } from '@opentelemetry/core';
8+
import { isTracingSuppressed } from '@opentelemetry/core';
99
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
1010
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
1111
import type { AggregationCounts, Client, SanitizedRequestData, Scope } from '@sentry/core';
@@ -24,6 +24,7 @@ import {
2424
logger,
2525
LRUMap,
2626
parseUrl,
27+
SDK_VERSION,
2728
stripUrlQueryAndFragment,
2829
withIsolationScope,
2930
} from '@sentry/core';
@@ -136,7 +137,7 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
136137
private _ignoreOutgoingRequestsMap: WeakMap<http.ClientRequest, boolean>;
137138

138139
public constructor(config: SentryHttpInstrumentationOptions = {}) {
139-
super(INSTRUMENTATION_NAME, VERSION, config);
140+
super(INSTRUMENTATION_NAME, SDK_VERSION, config);
140141

141142
this._propagationDecisionMap = new LRUMap<string, boolean>(100);
142143
this._ignoreOutgoingRequestsMap = new WeakMap<http.ClientRequest, boolean>();

packages/node-core/src/integrations/node-fetch/SentryNodeFetchInstrumentation.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
getTraceData,
1212
LRUMap,
1313
parseUrl,
14+
SDK_VERSION,
1415
} from '@sentry/core';
1516
import { shouldPropagateTraceForUrl } from '@sentry/opentelemetry';
1617
import * as diagch from 'diagnostics_channel';
@@ -24,9 +25,6 @@ const SENTRY_BAGGAGE_HEADER = 'baggage';
2425
// For baggage, we make sure to merge this into a possibly existing header
2526
const BAGGAGE_HEADER_REGEX = /baggage: (.*)\r\n/;
2627

27-
// Bump this whenever we make changes
28-
const VERSION = '1.0.0';
29-
3028
export type SentryNodeFetchInstrumentationOptions = InstrumentationConfig & {
3129
/**
3230
* Whether breadcrumbs should be recorded for requests.
@@ -68,7 +66,7 @@ export class SentryNodeFetchInstrumentation extends InstrumentationBase<SentryNo
6866
private _ignoreOutgoingRequestsMap: WeakMap<UndiciRequest, boolean>;
6967

7068
public constructor(config: SentryNodeFetchInstrumentationOptions = {}) {
71-
super('@sentry/instrumentation-node-fetch', VERSION, config);
69+
super('@sentry/instrumentation-node-fetch', SDK_VERSION, config);
7270
this._channelSubs = [];
7371
this._propagationDecisionMap = new LRUMap<string, boolean>(100);
7472
this._ignoreOutgoingRequestsMap = new WeakMap<UndiciRequest, boolean>();

0 commit comments

Comments
 (0)