Skip to content

Add unit tests for OTel context propagation on gRPC requests #547

@erichulburd

Description

@erichulburd

For context, see #544 (comment)

Goal:

Test that the traceparent metadata on execution and translation requests is set; assert that the value contains the hex representation of the OTel context trace id from the calling Python OTel span.

How:

  1. We need to fuller configurability TracingConfiguration that TracingConfiguration::from_env offers. See qcs-api-client-common issue 109 for some potential options.
  2. In the test_tracing_subscriber test module, add a test test_translation_submit_and_retrieve_grpc_trace_propagation. The TracingConfiguration should include the traceparent metadata key in the request metadata keys to ascribe as an attribute on the span.
  3. After reading the traces from file, look up the rpc.grpc.request.metadata.traceparent attribute on the gRPC spans; ensure that the value of this attribute contains the hex representation of the Python span's trace identifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions