Skip to content

Manual Instrumentation: Tracing flow breaks with Promise interface in Ratpack 1.x async operations #12990

@NaveenRamu

Description

@NaveenRamu

Describe the bug

When using manual instrumentation for tracing with the OpenTelemetry API in a Ratpack 1.x application, the trace context does not propagate correctly through asynchronous operations using the Promise interface. As a result, each handler in the flow creates a new traceId, breaking the trace continuity.

This issue is observed when multiple handlers in the Ratpack pipeline use Promise for asynchronous actions. The expected behavior is that all handlers should propagate the same trace context unless explicitly set otherwise.

Steps to reproduce

Run the following project
https://github.com/NaveenRamu/ratpack1x-manualinstrumentation.git
Observe the generated traces in logs

Expected behavior

The tracing context (e.g., traceId) should propagate across asynchronous boundaries, ensuring that all operations within a single request share the same trace.

Actual behavior

Each handler creates a new traceId, resulting in disjointed traces for a single request. This disrupts the ability to trace the complete flow of the request

Javaagent or library instrumentation version

1.42.1

Environment

JDK:
OS:

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