open-telemetry / open-telemetry/opentelemetry-python-contrib

why do traceresponsepropagators not extract?

Open
#4,946 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Currently, the Responsepropagator defines an inject method in its interface, but not an extract method? Why is this so?

If I receive a traceresponse in my response, the next thing I would want to do is extract this traceresponse header into a Context. But as I understand, all the otel provided extraction operations only know how to extract from traceparent (so I either need to roll a propagator of my own, or a custom Getter). This need to get traceparent from traceresponse feels likely enough that it should be accounted for somehow.

https://github.com/open-telemetry/opentelemetry-python-contrib/blob/038eb07ba1712b76a5ee7b38c54f46a535fbd0ad/opentelemetry-instrumentation/src/opentelemetry/instrumentation/propagators.py#L89-L114

if the current interface for response propagators is the preferred state, would a Getter be the recommended approach or would we be open to extending the Response interface to support extraction (or modifying the TraceContext propagators to also look for traceresponse)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with opentelemetry/instrumentation/propagators.py at the linked ResponsePropagator interface and trace how TraceContext propagators handle response headers. Compare the existing inject path with extraction APIs and related tests. Done requires a settled design for traceresponse extraction, including whether the interface, Getter, or propagator behavior should change, plus tests for the chosen approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.