|
1 | 1 | import { RemixInstrumentation } from 'opentelemetry-instrumentation-remix';
|
2 | 2 |
|
3 |
| -import { defineIntegration } from '@sentry/core'; |
4 |
| -import { SEMANTIC_ATTRIBUTE_SENTRY_OP, generateInstrumentOnce, getClient, spanToJSON } from '@sentry/node'; |
| 3 | +import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, defineIntegration } from '@sentry/core'; |
| 4 | +import { generateInstrumentOnce, getClient, spanToJSON } from '@sentry/node'; |
5 | 5 | import type { Client, IntegrationFn, Span } from '@sentry/types';
|
6 | 6 | import type { RemixOptions } from '../remixOptions';
|
7 | 7 |
|
@@ -47,13 +47,13 @@ const addRemixSpanAttributes = (span: Span): void => {
|
47 | 47 | // `requestHandler` span from `opentelemetry-instrumentation-remix` is the main server span.
|
48 | 48 | // It should be marked as the `http.server` operation.
|
49 | 49 | // The incoming requests are skipped by the custom `RemixHttpIntegration` package.
|
50 |
| - if (type === 'requestHandler') { |
51 |
| - span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'http.server'); |
52 |
| - return; |
53 |
| - } |
54 |
| - |
55 | 50 | // All other spans are marked as `remix` operations with their specific type [loader, action]
|
56 |
| - span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.remix`); |
| 51 | + const op = type === 'requestHandler' ? 'http.server' : `${type}.remix`; |
| 52 | + |
| 53 | + span.setAttributes({ |
| 54 | + [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.remix', |
| 55 | + [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, |
| 56 | + }); |
57 | 57 | };
|
58 | 58 |
|
59 | 59 | /**
|
|
0 commit comments