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

Use operation names as root span incident name in GraphQL instrumentation #791

Closed
unflxw opened this issue Nov 11, 2022 · 4 comments
Closed

Comments

@unflxw
Copy link
Contributor

unflxw commented Nov 11, 2022

As suggested in this Intercom conversation and this Slack conversation, it would be useful to use the GraphQL operation name as the root name, in order to group the queries by name in the performance actions view.

We may also want to improve on the existing GraphQL extractor in general. The current implementation just seeks to provide feature parity with 2.4 by obtaining the query for the execute span. All the non-execute kinds of spans (parse, validate, resolve) are just being converted to information-less "operation.graphql" spans. We should display those spans in a way that gives more information to the user.

@backlog-helper
Copy link

backlog-helper bot commented Nov 11, 2022

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

@tombruijn tombruijn changed the title Use operation names as root spans in GraphQL instrumentation Use operation names as root span incident name in GraphQL instrumentation Nov 14, 2022
@tombruijn
Copy link
Member

tombruijn commented Nov 14, 2022

  • Let's set the operation name as the root span name.
    • If no operation name is set, don't set a magic attribute for the name.
  • Let's set the namespace to graphql by default

Both items using magic attributes in the extractor.

@tombruijn tombruijn self-assigned this Nov 14, 2022
@tombruijn
Copy link
Member

@unflxw On PR https://github.com/appsignal/appsignal-agent/pull/853 you said we should look at the "operation.graphql" span names. The GraphQL instrumentation span names already have this kind of information, but in the wrong order. We could reorder the sub strings that make up the span names to do this.

WDYT, or are there other scenarios I don't know that can break like that?

Example of the reordering:

  • "graphql.execute" -> "execute.graphql"
  • "graphql.resolve" -> "resolve.graphql"
  • "graphql.validate" -> "validate.graphql"
  • "graphql.parse" -> "parse.graphql"

@unflxw
Copy link
Contributor Author

unflxw commented Nov 16, 2022

@tombruijn That sounds good to me. We do similar things for other instrumentations already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants