Skip to content

observability context not propagated #578

@jonenst

Description

@jonenst

Describe the current behavior

when flushing, network-store uses many threads. It doesn't set the observability context. This leads to losing the traceid in the resttemplates to the network-store-server

Describe the expected behavior

network-store-server writes during flush should have the traceid

Describe the steps

No response

Environment

No response

Relevant Log Output

No response

Extra Information

Example code

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>context-propagation</artifactId>
</dependency>
import io.micrometer.context.ContextExecutorService;
import io.micrometer.context.ContextSnapshotFactory;

// wrap(ExecutorService) is deprecated, micrometer wants us to be explicit
// wrap executor to propagate traceids from opened scopes in the threads
executorService = ContextExecutorService.wrap(threadPoolExecutor, () ->
    ContextSnapshotFactory.builder().build().captureAll()
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions