-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
LettuceObservationContext
should be constructed with parent Observation
if exists
#2591
Labels
type: bug
A general bug
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
May 31, 2023
quaff
added a commit
to quaff/spring-data-redis
that referenced
this issue
May 31, 2023
After this commit, LettuceObservationContext.setParentObservation() is called right after Context rather than Observation created, then Context.getParentObservation() could be used in ObservationPredicate to determine whether Observation should be created. Fix spring-projectsGH-2591
4 tasks
quaff
added a commit
to quaff/spring-data-redis
that referenced
this issue
May 31, 2023
After this commit, LettuceObservationContext.setParentObservation() is called right after Context rather than Observation created, then Context.getParentObservation() could be used in ObservationPredicate to determine whether Observation should be created. Fix spring-projectsGH-2591
Superseded by #2592 |
mp911de
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Jun 8, 2023
mp911de
changed the title
LettuceObservationContext should be constructed with parent Observation if exists
Jun 8, 2023
LettuceObservationContext
should be constructed with parent Observation
if exists
jxblum
pushed a commit
to jxblum/spring-data-redis
that referenced
this issue
Jun 8, 2023
After this commit, LettuceObservationContext.setParentObservation() is called right after Context rather than Observation created, then Context.getParentObservation() could be used in ObservationPredicate to determine whether Observation should be created. Fixes spring-projects#2591 Original pull request: spring-projects#2592
jxblum
pushed a commit
to jxblum/spring-data-redis
that referenced
this issue
Jun 8, 2023
Reformat code. Fix typo. See spring-projects#2591 Original pull request: spring-projects#2592
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
LettuceObservationContext.getParentObservation()
rely on micrometer default implementation, which get current observation fromThreadLocal
, but lettuce is executed in its own thread other than parent observation's thread, which lead toLettuceObservationContext.getParentObservation()
be null even it called within a parent observation scope,LettuceObservationContext.setParentObservation()
should be called before observation created, then we could useLettuceObservationContext.getParentObservation()
inObservationPredicate
, see also micrometer-metrics/micrometer#3867.https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-observation/src/main/java/io/micrometer/observation/SimpleObservationRegistry.java#L30-L47
The text was updated successfully, but these errors were encountered: