You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix parent Observation management in instrumentation
Prior to this commit, the `GraphQlObservationInstrumentation` was
incorrectly setting up the parent observation for both request execution
and data fetching observations.
In the case of the request execution, we were not looking into the
`GraphQLContext` for an existing observation - this commit ensures that
if such an observation exists, it is set as the parent.
As for the data fetching observation, we were incorrectly assuming that
the parent of all data fetching operations was the request execution
one, whereas data fetching operations can be nested. This commit ensures
that we only rely on the current observation in the GraphQL context.
Fixesgh-611
Copy file name to clipboardExpand all lines: spring-graphql/src/main/java/org/springframework/graphql/observation/GraphQlObservationInstrumentation.java
+27-17Lines changed: 27 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2020-2022 the original author or authors.
2
+
* Copyright 2020-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-graphql/src/test/java/org/springframework/graphql/observation/GraphQlObservationInstrumentationTests.java
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2020-2022 the original author or authors.
2
+
* Copyright 2020-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
0 commit comments