Skip to content
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

fix(tracing): align span operations to new operations #5891

Merged
merged 5 commits into from Oct 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,6 +24,6 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
expect(fidSpan?.op).toBe('web.vitals');
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
});
Expand Up @@ -21,12 +21,12 @@ conditionalTest({ min: 12 })('GraphQL/Apollo Tests', () => {
spans: [
{
description: 'execute',
op: 'db.graphql',
op: 'graphql.execute',
parent_span_id: parentSpanId,
},
{
description: 'Query.hello',
op: 'db.graphql.apollo',
op: 'graphql.resolve',
parent_span_id: graphqlSpanId,
},
],
Expand Down
Expand Up @@ -8,9 +8,9 @@ conditionalTest({ min: 12 })('Prisma ORM Integration', () => {
assertSentryTransaction(envelope[2], {
transaction: 'Test Transaction',
spans: [
{ description: 'User create', op: 'db.prisma' },
{ description: 'User findMany', op: 'db.prisma' },
{ description: 'User deleteMany', op: 'db.prisma' },
{ description: 'User create', op: 'db.sql.prisma' },
{ description: 'User findMany', op: 'db.sql.prisma' },
{ description: 'User deleteMany', op: 'db.sql.prisma' },
],
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/src/browser/metrics/index.ts
Expand Up @@ -221,7 +221,7 @@ export function addPerformanceEntries(transaction: Transaction): void {
_startChild(transaction, {
description: 'first input delay',
endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),
op: 'web.vitals',
op: 'ui.action',
startTimestamp: fidMark.value,
});

Expand Down Expand Up @@ -366,7 +366,7 @@ export function _addResourceSpans(
_startChild(transaction, {
description: resourceName,
endTimestamp,
op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource',
op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',
startTimestamp,
data,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/src/integrations/node/apollo.ts
Expand Up @@ -99,7 +99,7 @@ function wrapResolver(
const parentSpan = scope?.getSpan();
const span = parentSpan?.startChild({
description: `${resolverGroupName}.${resolverName}`,
op: 'db.graphql.apollo',
op: 'graphql.resolve',
});

const rv = orig.call(this, ...args);
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/src/integrations/node/express.ts
Expand Up @@ -140,7 +140,7 @@ function wrap(fn: Function, method: Method): (...args: any[]) => void {
if (transaction) {
const span = transaction.startChild({
description: fn.name,
op: `express.middleware.${method}`,
op: `middleware.express.${method}`,
});
res.once('finish', () => {
span.finish();
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/src/integrations/node/graphql.ts
Expand Up @@ -34,7 +34,7 @@ export class GraphQL implements Integration {

const span = parentSpan?.startChild({
description: 'execute',
op: 'db.graphql',
op: 'graphql.execute',
});

scope?.setSpan(span);
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/src/integrations/node/prisma.ts
Expand Up @@ -89,7 +89,7 @@ export class Prisma implements Integration {

const span = parentSpan?.startChild({
description: model ? `${model} ${action}` : action,
op: 'db.prisma',
op: 'db.sql.prisma',
});

const rv = next(params);
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/test/browser/metrics/index.test.ts
Expand Up @@ -101,11 +101,11 @@ describe('_addResourceSpans', () => {
const table = [
{
initiatorType: undefined,
op: 'resource',
op: 'resource.other',
},
{
initiatorType: '',
op: 'resource',
op: 'resource.other',
},
{
initiatorType: 'css',
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/test/integrations/apollo.test.ts
Expand Up @@ -86,7 +86,7 @@ describe('setupOnce', () => {
expect(scope.getSpan).toBeCalled();
expect(parentSpan.startChild).toBeCalledWith({
description: 'Query.res_1',
op: 'db.graphql.apollo',
op: 'graphql.resolve',
});
expect(childSpan.finish).toBeCalled();
});
Expand All @@ -96,7 +96,7 @@ describe('setupOnce', () => {
expect(scope.getSpan).toBeCalled();
expect(parentSpan.startChild).toBeCalledWith({
description: 'Mutation.res_2',
op: 'db.graphql.apollo',
op: 'graphql.resolve',
});
expect(childSpan.finish).toBeCalled();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/test/integrations/graphql.test.ts
Expand Up @@ -48,7 +48,7 @@ describe('setupOnce', () => {
expect(scope.getSpan).toBeCalled();
expect(parentSpan.startChild).toBeCalledWith({
description: 'execute',
op: 'db.graphql',
op: 'graphql.execute',
});
expect(childSpan.finish).toBeCalled();
expect(scope.setSpan).toHaveBeenCalledTimes(2);
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing/test/integrations/node/prisma.test.ts
Expand Up @@ -52,7 +52,7 @@ describe('setupOnce', function () {
expect(scope.getSpan).toBeCalled();
expect(parentSpan.startChild).toBeCalledWith({
description: 'user create',
op: 'db.prisma',
op: 'db.sql.prisma',
});
expect(childSpan.finish).toBeCalled();
done();
Expand Down