Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function assertParseSpan(channelName: string): Promise<void> {
const parseSpan = parent.spans?.find(s => s.description === 'graphql.parse');
assertExists(parseSpan, `expected a graphql.parse span, got: ${parent.spans?.map(s => s.description).join(', ')}`);
assertEquals(parseSpan!.op, 'graphql');
assertEquals(parseSpan!.data?.['sentry.origin'], 'auto.graphql.diagnostic_channel');
assertEquals(parseSpan!.data?.['sentry.origin'], 'auto.graphql.graphql');
}

Deno.test('graphql instrumentation: included in default integrations (Deno 2.8.0+)', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ test('Should trace outgoing fetch requests inside middleware', async ({ request
'server.address': { value: 'localhost', type: 'string' },
'server.port': { value: 3030, type: 'integer' },
'sentry.op': { value: 'http.client', type: 'string' },
'sentry.origin': { value: 'auto.http.wintercg_fetch', type: 'string' },
'sentry.origin': { value: 'auto.http.fetch', type: 'string' },
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test('Instruments mongoose automatically', async ({ baseURL }) => {
expect(getSpanOp(rootSpan!)).toBe('http.server');

const mongooseSpans = spans.filter(
span => span.attributes['sentry.origin']?.value === 'auto.db.mongoose.diagnostic_channel',
span => span.attributes['sentry.origin']?.value === 'auto.db.mongoose.native_channel',
);
expect(mongooseSpans).toHaveLength(2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('Instruments mongoose automatically', async ({ baseURL }) => {
const spans = await spansPromise;

const mongooseSpans = spans.filter(
span => span.attributes['sentry.origin']?.value === 'auto.db.mongoose.diagnostic_channel',
span => span.attributes['sentry.origin']?.value === 'auto.db.mongoose.native_channel',
);
expect(mongooseSpans).toHaveLength(2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('graphqlIntegration', () => {
type: 'string',
});
expect(executeSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('GraphQL/Apollo Tests > resolve spans', () => {
expect(executeSpan?.attributes['graphql.processing.type']).toEqual({ value: 'execute', type: 'string' });
expect(executeSpan?.attributes['graphql.document']).toEqual({ value: '{hello}', type: 'string' });
expect(executeSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
const parseSpan = children.find(span => span.attributes['graphql.processing.type']?.value === 'parse');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('GraphQL/Apollo Tests', () => {
expect(executeSpan?.attributes['graphql.operation.type']).toEqual({ value: 'query', type: 'string' });
expect(executeSpan?.attributes['graphql.document']).toEqual({ value: '{hello}', type: 'string' });
expect(executeSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
},
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('GraphQL/Apollo Tests', () => {
type: 'string',
});
expect(mutationSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
},
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('GraphQL/Apollo Tests', () => {
type: 'string',
});
expect(executeSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
},
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('GraphQL/Apollo Tests', () => {
type: 'string',
});
expect(mutationSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
type: 'string',
});
expect(getHelloSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(getHelloSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
type: 'string',
});
expect(testMutationSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(testMutationSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
expect(executeSpan?.attributes['graphql.operation.type']).toEqual({ value: 'query', type: 'string' });
expect(executeSpan?.attributes['graphql.document']).toEqual({ value: 'query {hello}', type: 'string' });
expect(executeSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(executeSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
type: 'string',
});
expect(getHelloSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(getHelloSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
Expand All @@ -184,7 +184,7 @@ describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
type: 'string',
});
expect(getWorldSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(getWorldSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe.runIf(supports({ min: 22 }))('GraphQL tracing channel Test > resolve sp
expect(helloResolverSpan?.name).toBe('GraphQL resolve');
expect(helloResolverSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
expect(helloResolverSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(helloResolverSpan?.attributes['graphql.field.name']).toEqual({ value: 'hello', type: 'string' });
Expand All @@ -65,7 +65,7 @@ describe.runIf(supports({ min: 22 }))('GraphQL tracing channel Test > resolve sp
expect(userResolverSpan?.name).toBe('GraphQL resolve');
expect(userResolverSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
expect(userResolverSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(userResolverSpan?.attributes['graphql.field.name']).toEqual({ value: 'user', type: 'string' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe.runIf(supports({ min: 22 }))('GraphQL tracing channel Test', () => {
expect(executeSpan?.name).toBe('GraphQL query');
expect(executeSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
expect(executeSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(executeSpan?.attributes['graphql.operation.type']).toEqual({ value: 'query', type: 'string' });
Expand All @@ -54,7 +54,7 @@ describe.runIf(supports({ min: 22 }))('GraphQL tracing channel Test', () => {
expect(getUserSpan?.name).toBe('GraphQL query');
expect(getUserSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
expect(getUserSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(getUserSpan?.attributes['graphql.operation.type']).toEqual({ value: 'query', type: 'string' });
Expand All @@ -71,7 +71,7 @@ describe.runIf(supports({ min: 22 }))('GraphQL tracing channel Test', () => {
expect(loginSpan?.name).toBe('GraphQL mutation');
expect(loginSpan?.attributes['sentry.op']).toEqual({ value: 'graphql', type: 'string' });
expect(loginSpan?.attributes['sentry.origin']).toEqual({
value: 'auto.graphql.diagnostic_channel',
value: 'auto.graphql.graphql',
type: 'string',
});
expect(loginSpan?.attributes['graphql.operation.name']).toEqual({ value: 'Login', type: 'string' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describeWithDockerCompose(
cleanupChildProcesses();
});

const ORIGIN = 'auto.db.redis.diagnostic_channel';
const ORIGIN = 'auto.db.redis.native_channel';
const SEGMENT_NAME = 'Test Span IORedis DC';
const HOST = '127.0.0.1';
const PORT = 6382;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Mongoose tracing channel Test', () => {
[DB_OPERATION_NAME]: { type: 'string', value: operation },
[DB_SYSTEM_NAME]: { type: 'string', value: 'mongodb' },
[SENTRY_OP]: { type: 'string', value: DB },
[SENTRY_ORIGIN]: { type: 'string', value: 'auto.db.mongoose.diagnostic_channel' },
[SENTRY_ORIGIN]: { type: 'string', value: 'auto.db.mongoose.native_channel' },
[SENTRY_TRACE_LIFECYCLE]: { type: 'string', value: 'stream' },
[SERVER_ADDRESS]: { type: 'string', value: expect.any(String) },
[SERVER_PORT]: { type: 'integer', value: expect.any(Number) },
Expand Down Expand Up @@ -98,7 +98,7 @@ describe('Mongoose tracing channel Test', () => {
expect(spans.find(span => span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose')).toBeUndefined();
// ...while the diagnostics-channel path is active.
expect(
spans.find(span => span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.diagnostic_channel'),
spans.find(span => span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.native_channel'),
).toBeDefined();
},
})
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('Mongoose tracing channel Test', () => {
const mongooseSave = spans.find(
span =>
span.name === 'save blogposts' &&
span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.diagnostic_channel',
span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.native_channel',
);
expect(mongooseSave).toBeDefined();
// the underlying mongodb driver span must parent to the mongoose channel span,
Expand All @@ -157,7 +157,7 @@ describe('Mongoose tracing channel Test', () => {
const cursorFind = spans.find(
span =>
span.name === 'find blogposts' &&
span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.diagnostic_channel',
span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.native_channel',
);
expect(cursorFind).toBeDefined();
expect(cursorFind?.attributes[DB_QUERY_TEXT]).toBeUndefined();
Expand All @@ -184,7 +184,7 @@ describe('Mongoose tracing channel Test', () => {
const aggregateSpan = container.items.find(
item =>
item.name === 'aggregate blogposts' &&
item.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.diagnostic_channel',
item.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mongoose.native_channel',
);
expect(aggregateSpan).toBeDefined();
expect(aggregateSpan?.status).toBe('error');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('mysql2 tracing channel Test', () => {
const expectedQuerySpan = (queryText: string) =>
expect.objectContaining({
attributes: expect.objectContaining({
[SENTRY_ORIGIN]: { type: 'string', value: 'auto.db.mysql2.diagnostic_channel' },
[SENTRY_ORIGIN]: { type: 'string', value: 'auto.db.mysql2.native_channel' },
[DB_SYSTEM_NAME]: { type: 'string', value: 'mysql' },
[DB_OPERATION_NAME]: { type: 'string', value: 'SELECT' },
[DB_QUERY_TEXT]: { type: 'string', value: queryText },
Expand All @@ -47,7 +47,7 @@ describe('mysql2 tracing channel Test', () => {
expect.objectContaining({
attributes: expect.objectContaining({
[SENTRY_OP]: { type: 'string', value: DB },
[SENTRY_ORIGIN]: { type: 'string', value: 'auto.db.mysql2.diagnostic_channel' },
[SENTRY_ORIGIN]: { type: 'string', value: 'auto.db.mysql2.native_channel' },
[DB_QUERY_TEXT]: { type: 'string', value: 'SELECT * FROM does_not_exist' },
}),
name: 'SELECT does_not_exist',
Expand All @@ -72,7 +72,7 @@ describe('mysql2 tracing channel Test', () => {
expect(spans.find(span => span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mysql2')).toBeUndefined();
// ...while the diagnostics-channel path is active.
expect(
spans.find(span => span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mysql2.diagnostic_channel'),
spans.find(span => span.attributes[SENTRY_ORIGIN]?.value === 'auto.db.mysql2.native_channel'),
).toBeDefined();
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describeWithDockerCompose(
});
});

const ORIGIN = 'auto.db.redis.diagnostic_channel';
const ORIGIN = 'auto.db.redis.native_channel';
const SEGMENT_NAME = 'Test Span Redis 5 DC';
const HOST = '127.0.0.1';
const PORT = 6381;
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/test-utils/src/bundler-instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface InstrumentationFixture {
const FIXTURES: Record<string, InstrumentationFixture> = {
graphql: {
moduleName: 'graphql',
origin: 'auto.graphql.diagnostic_channel',
origin: 'auto.graphql.graphql',
sourceMarker: 'GraphQLSchema',
assertResult: result => (result as { data?: { hello?: string } })?.data?.hello === 'world',
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/lib/integrations/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('createFetchIntegration', () => {
it('uses the span origin it was created with', () => {
const winterCGFetchIntegration = createFetchIntegration({
name: 'WinterCGFetch',
spanOrigin: 'auto.http.wintercg_fetch',
spanOrigin: 'auto.http.fetch',
});

const handler = setupIntegration(winterCGFetchIntegration(), client);
Expand All @@ -94,7 +94,7 @@ describe('createFetchIntegration', () => {
expect.any(Function),
expect.any(Function),
expect.any(Object),
expect.objectContaining({ spanOrigin: 'auto.http.wintercg_fetch' }),
expect.objectContaining({ spanOrigin: 'auto.http.fetch' }),
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodNa
onlyIfParent: true,
attributes: {
[SENTRY_OP]: GRPC,
[SENTRY_ORIGIN]: 'auto.grpc.serverless',
[SENTRY_ORIGIN]: 'auto.grpc.google_cloud',
[RPC_SYSTEM_NAME]: 'grpc',
[RPC_SERVICE]: serviceIdentifier,
[RPC_METHOD]: methodName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('GoogleCloudGrpc tracing', () => {
onlyIfParent: true,
attributes: {
[SENTRY_OP]: 'grpc',
[SENTRY_ORIGIN]: 'auto.grpc.serverless',
[SENTRY_ORIGIN]: 'auto.grpc.google_cloud',
'rpc.system.name': 'grpc',
'rpc.service': 'test-service',
'rpc.method': 'unaryMethod',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Shared by both graphql paths (orchestrion for v14–16, diagnostics channels for >= 17) so they emit
// identical spans.

export const ORIGIN = 'auto.graphql.diagnostic_channel';
export const ORIGIN = 'auto.graphql.graphql';

export const SPAN_NAME_PARSE = 'graphql.parse';
export const SPAN_NAME_VALIDATE = 'graphql.validate';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = 'mongoose:model:insertMany'
export const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = 'mongoose:model:bulkWrite';
export const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = 'mongoose:cursor:next';

const ORIGIN = 'auto.db.mongoose.diagnostic_channel';
const ORIGIN = 'auto.db.mongoose.native_channel';
const DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb';

// Cap recursion so a self-referential or pathologically deep query can never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const MYSQL2_DC_CHANNEL_EXECUTE = 'mysql2:execute';
export const MYSQL2_DC_CHANNEL_CONNECT = 'mysql2:connect';
export const MYSQL2_DC_CHANNEL_POOL_CONNECT = 'mysql2:pool:connect';

const ORIGIN = 'auto.db.mysql2.diagnostic_channel';
const ORIGIN = 'auto.db.mysql2.native_channel';
const DB_SYSTEM_NAME_VALUE_MYSQL = 'mysql';

// Leading keyword of a SQL statement (SELECT, INSERT, …) → `db.operation.name`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const REDIS_DC_CHANNEL_CONNECT = 'node-redis:connect';
export const IOREDIS_DC_CHANNEL_COMMAND = 'ioredis:command';
export const IOREDIS_DC_CHANNEL_CONNECT = 'ioredis:connect';

const ORIGIN = 'auto.db.redis.diagnostic_channel';
const ORIGIN = 'auto.db.redis.native_channel';
const DB_SYSTEM_NAME_VALUE_REDIS = 'redis';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('subscribeMysql2DiagnosticChannels', () => {
const json = spanToJSON(span!);
expect(json.name).toBe('SELECT solution FROM maths');
expect(json.attributes['sentry.op']).toBe('db');
expect(json.attributes['sentry.origin']).toBe('auto.db.mysql2.diagnostic_channel');
expect(json.attributes['sentry.origin']).toBe('auto.db.mysql2.native_channel');
expect(json.attributes['db.system.name']).toBe('mysql');
expect(json.attributes['db.operation.name']).toBe('SELECT');
// reported regardless of trace lifecycle, even though only span streaming names the span after it
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('subscribeMysql2DiagnosticChannels', () => {
const json = spanToJSON(span!);
expect(json.name).toBe('mysql2.connect');
expect(json.attributes['sentry.op']).toBe('db');
expect(json.attributes['sentry.origin']).toBe('auto.db.mysql2.diagnostic_channel');
expect(json.attributes['sentry.origin']).toBe('auto.db.mysql2.native_channel');
expect(json.attributes['db.system.name']).toBe('mysql');
expect(json.attributes['db.namespace']).toBe('test');
expect(json.attributes['server.address']).toBe('127.0.0.1');
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel-edge/src/integrations/wintercg-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import { createFetchIntegration } from '@sentry/core';
*/
export const winterCGFetchIntegration = createFetchIntegration({
name: 'WinterCGFetch',
spanOrigin: 'auto.http.wintercg_fetch',
spanOrigin: 'auto.http.fetch',
});
Loading
Loading