Skip to content

Conversation

@tinnou
Copy link
Collaborator

@tinnou tinnou commented Jan 14, 2026

Pull request checklist

  • Please read our contributor guide
  • Consider creating a discussion on the discussion forum
    first
  • Make sure the PR doesn't introduce backward compatibility issues
  • Make sure to have sufficient test cases

Pull Request type

  • Feature

This PR unlocks providing richer information for the gql.resolver metric using the beginFieldFetching instead of instrumentDataFetcher instrumentation hook. In graphql-java 26.x, a new callback onExceptionHandled was added, which allows observing the data fetcher result after exception handling has occurred. This allows the DGS framework to collect final error information on the data fetcher result and to compute latency on a single metric.

An additional interface DgsFieldFetchDataFetcherResultTagCustomizer has been introduced to ultimately replace DgsFieldFetchTagCustomizer which is now deprecated but still present for backward compatibility.

Note: Both of these functional interfaces are called but DgsFieldFetchDataFetcherResultTagCustomizer takes precedence if the same tag keys happened to be collected.

⚠️ graphql-java 26 has not yet been released and this PR is working with a snapshot version of master, whenever graphql-java 26 is released this PR can be updated to use the release version and promoted from draft.

Steps taken:
- delete dependencies.lock file in every module
- update graphql-dgs-platform to strictly enforce snapshot version
- ensure the graphql-java version from graphql-dgs-platform takes precedence over the Spring Boot one as it also manages graphql-java
- re-gen the dependencies.lock files
to grab the ChainedInstrumentation change
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters
import io.micrometer.core.instrument.Tag

@Deprecated("Use DgsFieldFetchDataFetcherResultTagCustomizer instead")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rather deprecate or remove and bump the framework version?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant