-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(opentelemetry): Add new @sentry/opentelemetry
package
#9238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,26 +24,26 @@ | |
}, | ||
"dependencies": { | ||
"@opentelemetry/api": "~1.6.0", | ||
"@opentelemetry/context-async-hooks": "~1.17.0", | ||
"@opentelemetry/core": "~1.17.0", | ||
"@opentelemetry/instrumentation": "~0.43.0", | ||
"@opentelemetry/instrumentation-express": "~0.33.1", | ||
"@opentelemetry/instrumentation-fastify": "~0.32.3", | ||
"@opentelemetry/instrumentation-graphql": "~0.35.1", | ||
"@opentelemetry/instrumentation-http": "~0.43.0", | ||
"@opentelemetry/instrumentation-mongodb": "~0.37.0", | ||
"@opentelemetry/instrumentation-mongoose": "~0.33.1", | ||
"@opentelemetry/instrumentation-mysql": "~0.34.1", | ||
"@opentelemetry/instrumentation-mysql2": "~0.34.1", | ||
"@opentelemetry/instrumentation-nestjs-core": "~0.33.1", | ||
"@opentelemetry/instrumentation-pg": "~0.36.1", | ||
"@opentelemetry/resources": "~1.17.0", | ||
"@opentelemetry/sdk-trace-base": "~1.17.0", | ||
"@opentelemetry/semantic-conventions": "~1.17.0", | ||
"@prisma/instrumentation": "~5.3.1", | ||
"@opentelemetry/core": "~1.17.1", | ||
"@opentelemetry/context-async-hooks": "~1.17.1", | ||
"@opentelemetry/instrumentation": "0.44.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hard-pinned all instrumentation dependencies, and pinned the "core" dependencies to bugfixes. LMK if you think we should hard pin everything 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is fine - we can always adjust it afterwards too if it ends up breaking something. |
||
"@opentelemetry/instrumentation-express": "0.33.2", | ||
"@opentelemetry/instrumentation-fastify": "0.32.3", | ||
"@opentelemetry/instrumentation-graphql": "0.35.2", | ||
"@opentelemetry/instrumentation-http": "0.44.0", | ||
"@opentelemetry/instrumentation-mongodb": "0.37.1", | ||
"@opentelemetry/instrumentation-mongoose": "0.33.2", | ||
"@opentelemetry/instrumentation-mysql": "0.34.2", | ||
"@opentelemetry/instrumentation-mysql2": "0.34.2", | ||
"@opentelemetry/instrumentation-nestjs-core": "0.33.2", | ||
"@opentelemetry/instrumentation-pg": "0.36.2", | ||
"@opentelemetry/resources": "~1.17.1", | ||
"@opentelemetry/sdk-trace-base": "~1.17.1", | ||
"@opentelemetry/semantic-conventions": "~1.17.1", | ||
"@prisma/instrumentation": "5.4.2", | ||
"@sentry/core": "7.74.1", | ||
"@sentry/node": "7.74.1", | ||
"@sentry/opentelemetry-node": "7.74.1", | ||
"@sentry/opentelemetry": "7.74.1", | ||
"@sentry/types": "7.74.1", | ||
"@sentry/utils": "7.74.1", | ||
"opentelemetry-instrumentation-fetch-node": "1.1.0" | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,14 @@ import { SpanKind } from '@opentelemetry/api'; | |
import { registerInstrumentations } from '@opentelemetry/instrumentation'; | ||
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'; | ||
import { hasTracingEnabled, isSentryRequestUrl } from '@sentry/core'; | ||
import { _INTERNAL, getCurrentHub, getSpanKind, setSpanMetadata } from '@sentry/opentelemetry'; | ||
import type { EventProcessor, Hub, Integration } from '@sentry/types'; | ||
import { stringMatchesSomePattern } from '@sentry/utils'; | ||
import type { ClientRequest, IncomingMessage, ServerResponse } from 'http'; | ||
|
||
import { OTEL_ATTR_ORIGIN } from '../constants'; | ||
import { setSpanMetadata } from '../opentelemetry/spanData'; | ||
import type { NodeExperimentalClient } from '../sdk/client'; | ||
import { getCurrentHub } from '../sdk/hub'; | ||
import { getRequestSpanData } from '../utils/getRequestSpanData'; | ||
import type { NodeExperimentalClient } from '../types'; | ||
import { addOriginToSpan } from '../utils/addOriginToSpan'; | ||
import { getRequestUrl } from '../utils/getRequestUrl'; | ||
import { getSpanKind } from '../utils/getSpanKind'; | ||
|
||
interface HttpOptions { | ||
/** | ||
|
@@ -148,7 +145,7 @@ export class Http implements Integration { | |
|
||
/** Update the span with data we need. */ | ||
private _updateSpan(span: Span, request: ClientRequest | IncomingMessage): void { | ||
span.setAttribute(OTEL_ATTR_ORIGIN, 'auto.http.otel.http'); | ||
addOriginToSpan(span, 'auto.http.otel.http'); | ||
|
||
if (getSpanKind(span) === SpanKind.SERVER) { | ||
setSpanMetadata(span, { request }); | ||
|
@@ -161,7 +158,7 @@ export class Http implements Integration { | |
return; | ||
} | ||
|
||
const data = getRequestSpanData(span); | ||
const data = _INTERNAL.getRequestSpanData(span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. m: This There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's fine because it's dependent on us making some decisions around schema/naming. Internal is sufficiently scary enough that things shouldn't be used with it, and it will be going away very soon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah so this should definitely go away, I just want to avoid exposing things publicly that we need right now because then we can't remove them easily later :) once the semantic attributes stuff is merged and agreed upon this can/should just be public API! |
||
getCurrentHub().addBreadcrumb( | ||
{ | ||
category: 'http', | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prob also need to add this to the verdaccio config for the e2e tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not automatically be picked up there? 🤔 based on the namespace...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No unfortunately not:
sentry-javascript/packages/e2e-tests/verdaccio-config/config.yaml
Lines 29 to 39 in cadeefe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
damn, good catch! I'll actually add this here as well, is missing there so far: https://github.com/getsentry/sentry-javascript/blob/develop/docs/new-sdk-release-checklist.md