Skip to content

Tracing Context Breaks with manual instrumentation when async method Invokes by ratpack for a single request #12363

@NaveenRamu

Description

@NaveenRamu

Describe the bug

When using Ratpack2 with OpenTelemetry (Otel) manual instrumentation in a reactive environment, tracing continuity can break when synchronous methods are invoked. This loss of trace context leads to incomplete or broken traces, resulting in the generation of a new tracing ID for subsequent invocations.

Steps to reproduce

Download the attached sample code and execute it. After execution, import the provided Postman collection and send the request. Observe the logs. GitHub Link

Expected behavior

Only one trace ID should be generated across all spans for a single API request to ensure continuity in tracing.

Actual behavior

Different trace ids are generated for each method execution.

Javaagent or library instrumentation version

ratpack-1.7

Environment

JDK: 1.8
OS: Linux
Framework: Ratpack2 (version: 2.0.0-rc-1)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds author feedbackWaiting for additional feedback from the authorneeds triageNew issue that requires triagestale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions