Skip to content

LettuceObservationContext should be constructed with parent Observation if exists #2591

Closed
@quaff

Description

@quaff

Currently LettuceObservationContext.getParentObservation() rely on micrometer default implementation, which get current observation from ThreadLocal, but lettuce is executed in its own thread other than parent observation's thread, which lead to LettuceObservationContext.getParentObservation() be null even it called within a parent observation scope, LettuceObservationContext.setParentObservation() should be called before observation created, then we could use LettuceObservationContext.getParentObservation() in ObservationPredicate, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions