|
1 | | -import type { ClientRequest, IncomingMessage, RequestOptions, ServerResponse } from 'node:http'; |
2 | 1 | import { diag } from '@opentelemetry/api'; |
3 | 2 | import type { HttpInstrumentationConfig } from '@opentelemetry/instrumentation-http'; |
4 | 3 | import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'; |
5 | | -import { Span, hasSpansEnabled } from '@sentry/core'; |
6 | | -import { defineIntegration, getClient } from '@sentry/core'; |
| 4 | +import type { Span } from '@sentry/core'; |
| 5 | +import { defineIntegration, getClient, hasSpansEnabled } from '@sentry/core'; |
| 6 | +import type { ClientRequest, IncomingMessage, RequestOptions, ServerResponse } from 'node:http'; |
7 | 7 | import { generateInstrumentOnce } from '../../otel/instrument'; |
8 | 8 | import type { NodeClient } from '../../sdk/client'; |
9 | 9 | import type { HTTPModuleRequestIncomingMessage } from '../../transports/http-module'; |
@@ -137,7 +137,9 @@ export const instrumentOtelHttp = generateInstrumentOnce<HttpInstrumentationConf |
137 | 137 | export function _shouldInstrumentSpans(options: HttpOptions, clientOptions: Partial<NodeClientOptions> = {}): boolean { |
138 | 138 | // If `spans` is passed in, it takes precedence |
139 | 139 | // Else, we by default emit spans, unless `skipOpenTelemetrySetup` is set to `true` or spans are not enabled |
140 | | - return typeof options.spans === 'boolean' ? options.spans : !clientOptions.skipOpenTelemetrySetup && hasSpansEnabled(clientOptions); |
| 140 | + return typeof options.spans === 'boolean' |
| 141 | + ? options.spans |
| 142 | + : !clientOptions.skipOpenTelemetrySetup && hasSpansEnabled(clientOptions); |
141 | 143 | } |
142 | 144 |
|
143 | 145 | /** |
|
0 commit comments