Skip to content

Conversation

@antogyn
Copy link

@antogyn antogyn commented Dec 9, 2025

Which problem is this PR solving?

I am trying to derive performance metrics from GraphQL traces.

Currently, I cannot consistently measure the performance of a specific, logical resolver, identified by the combination of its parent type name and field name.

While the existing graphql.field.path attribute is available, it is query-path dependent. Consider this simplified schema and two queries hitting the same name resolver:

type Account {
  name: String! # <-- Logical Resolver: Account.name
}
type Query {
  account(id: ID!): Account # Query 1
  user(id: ID!): User
}
type User {
  accounts: [Account!]! # Query 2
}
Execution Field Name (graphql.field.name) Field Path (graphql.field.path)
Query 1: query { account { name } } name Query.account.name
Query 2: query { user { accounts { name } } } name Query.user.accounts.name

Both queries execute the same Account.name resolver, but the existing graphql.field.path differs. This makes it impossible to aggregate all performance data for Account.name using the existing attributes.

Short description of the changes

This PR adds the parent type name to a new attribute on resolver spans

  1. I've added graphql.parent.name to the AttributeNames enum.
  2. The instrumentation records the parent type name using info.parentType.name in this new attribute.

@antogyn antogyn requested a review from a team as a code owner December 9, 2025 17:50
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 9, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: antogyn / name: Anthony Giniers (055910f)

@antogyn antogyn force-pushed the feat/graphql-parent-name branch from 57332a0 to 055910f Compare December 11, 2025 13:47
@antogyn antogyn changed the title feat(graphql): add parent name in attributes of resolver span feat(instrumentation-graphql): add parent name in attributes of resolver span Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants