Skip to content

Commit de70b31

Browse files
committed
Expect the default manual origin on streamed mysql and postgres db spans
Under the SentryTracerProvider, streamed spans carry `sentry.origin` as a first-class attribute including the default `manual` value, whereas the OpenTelemetry SDK path omits the `manual` default. The `mysql` (v1) db spans and the `pg.connect` span set no explicit origin, so they surface as `manual` here. Assert it for now. When those instrumentations are reworked to set an explicit `auto.db.otel.*` origin (e.g. #21568 for mysql), these expectations will be updated to the real origin then.
1 parent 0470fd3 commit de70b31

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • dev-packages/node-integration-tests/suites/tracing/postgres-streamed

dev-packages/node-integration-tests/suites/tracing/postgres-streamed/test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ const COMMON_DB_ATTRIBUTES = {
7373

7474
/**
7575
* Builds the expected strict shape of a streamed postgres db span.
76-
* The `pg.connect` span has neither a `db.statement` nor a `sentry.origin`,
77-
* whereas query spans carry both.
76+
* Query spans carry a `db.statement` and the `auto.db.otel.postgres` origin. The `pg.connect` span
77+
* has no `db.statement`, and since the pg instrumentation sets no origin on it, it carries the
78+
* default `manual` origin (written as an attribute on the streamed-span path; the non-streamed/SDK
79+
* path omits the `manual` default).
7880
*/
7981
function expectedDbSpan({ name, statement }: { name: string; statement?: string }): unknown {
8082
const attributes: Record<string, unknown> = { ...COMMON_DB_ATTRIBUTES };
@@ -88,6 +90,11 @@ function expectedDbSpan({ name, statement }: { name: string; statement?: string
8890
type: 'string',
8991
value: 'auto.db.otel.postgres',
9092
};
93+
} else {
94+
attributes['sentry.origin'] = {
95+
type: 'string',
96+
value: 'manual',
97+
};
9198
}
9299

93100
return {

0 commit comments

Comments
 (0)