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

Wrong current observation is set during DataFetcher execution #764

Closed
github-actions bot opened this issue Aug 3, 2023 · 1 comment
Closed

Wrong current observation is set during DataFetcher execution #764

github-actions bot opened this issue Aug 3, 2023 · 1 comment
Assignees
Labels
in: core Issues related to config and core support type: backport type: bug A general bug
Milestone

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

Backport of gh-757

@github-actions github-actions bot added this to the 1.1.6 milestone Aug 3, 2023
@bclozel bclozel changed the title Micrometer Tracing - Nested datafetcher spans Wrong current observation is set during DataFetcher execution Aug 17, 2023
@bclozel bclozel added the in: core Issues related to config and core support label Aug 17, 2023
bclozel added a commit that referenced this issue Aug 17, 2023
Prior to this commit, the Observability instrumentation would instrument
`DataFetcher` instances and set the current observation in the local
context of the value returned by the data fetcher itself.
This allowed to properly build a parent/child chain of observations
between the main request and the instrumented data fetching
observations.

Because the current observation was not set in the
`DataFetchingEnvironment` given as a parameter to the data fetcher, any
operation done in the data fetcher would not propagate using the current
observation but instead the parent one.

This commit revisits the implementation of the instrumentation to not
wrap the result anymore, but to build a new local `GraphQLContext` that
holds the current observation right before calling the data fetcher.
Note that we cannot "just" set the current observation in that local
context as this is shared mutable instance for all child data fetchers.

Fixes gh-764
@github-actions
Copy link
Contributor Author

Fixed via ae5b7e7

@bclozel bclozel self-assigned this Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues related to config and core support type: backport type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant