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

@opentelemetry/instrumentation-graphql sets graphql.operation.name span attribute to operation type #847

Closed
sfishel-splunk opened this issue Jan 21, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@sfishel-splunk
Copy link

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

"@opentelemetry/api": "^1.0.2",
"@opentelemetry/core": "^1.0.1",
"@opentelemetry/instrumentation-graphql": "^0.27.1",

What version of Node are you using?

v12.22.4

Please provide the code you used to setup the OpenTelemetry SDK

I'm using @splunk/otel, the setup code looks like this:

startTracing({
  serviceName: environment.serviceName,
  instrumentations: [
    new GraphQLInstrumentation({ mergeItems: true, depth: 1 }),
    new HttpInstrumentation({
      ignoreOutgoingUrls: [/v1\/trace/, /v2\/datapoint/, /v2\/spans/],
    }),
    new ExpressInstrumentation({ ignoreLayersType: [ExpressLayerType.MIDDLEWARE, ExpressLayerType.ROUTER] })
  ],
  spanExporterFactory: () => new ZipkinExporter({ url: endpoint }),
  tracerConfig: {
    resource: new Resource(otelServiceAndEnvironment)
  },
  propagatorFactory: () =>
    new CompositePropagator({
      propagators: [new B3Propagator(), new W3CTraceContextPropagator()]
    })
});

What did you do?

I applied the above instrumentation configuration to an Apollo graphql server.

What did you expect to see?

I expected the graphql.operation.name span attribute to be set to the operation name as defined here.

What did you see instead?

Instead the graphql.operation.name span attribute is set to the operation type (e.g. "query")

@vmarchaud vmarchaud transferred this issue from open-telemetry/opentelemetry-js Jan 23, 2022
@vmarchaud vmarchaud added bug Something isn't working up-for-grabs Good for taking. Extra help will be provided by maintainers labels Jan 23, 2022
@mentos1386
Copy link
Contributor

Similar to #705

@dchambers
Copy link
Contributor

@dyladan / @mentos1386, would you be open to me creating a PR to fix this bug?

@dyladan
Copy link
Member

dyladan commented Feb 15, 2022

of course

@dyladan dyladan removed the up-for-grabs Good for taking. Extra help will be provided by maintainers label Feb 15, 2022
@jscherer92
Copy link
Contributor

@dyladan can we get this issue closed since a merge was supposed to fix this? Trying scroll through our bugs list and get it cleaned up a bit :)

Thanks!

@Flarna
Copy link
Member

Flarna commented Apr 26, 2022

fixed by #903

@Flarna Flarna closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants