open-telemetry / open-telemetry/opentelemetry-cpp-contrib

`b3` propagator not working when internal redirect

Open
#473 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

instrumentation:nginx
Dominant language
Python
Stars
153
Forks
184
Avg merge
2d 9h
Merged PRs (30d)
26

Description

In APIcast, the opentelemetry instrumentations is working for the default W3C propagator. When trying to switch to b3 propagation type (i.e. opentelemetry_propagate b3;) propagation stops working, even though traces are still being sent to the collector.

Describe your environment

Steps to reproduce

Trying to narrow down the relevant nginx configuration used in APIcast, simplified for the shake of this issue, it looks something like this:

location / {                              
  content_by_lua_block {
    ngx.exec("@otel");                     
  }                                          
}                                       
                               
location @otel {                             
  internal;

  opentelemetry_operation_name apicast; 
  opentelemetry_propagate b3;                   
  proxy_pass http://example.com;             
}                                            

What is the expected behavior?
The request propagation of distributed tracing headers for the b3 type. When no parent trace is given, a new trace will be started. So, upstream request to example.com should have the B3 tracing header.

What is the actual behavior?
The distributed tracing headers (i.e. the B3 header) are not propagated and no new trace is started when no parent trace is given. So, the upstream request to example.com does not have the B3 header. Furthermore, if there is a parent trace, the upstream request to example.com has the B3 header being removed.

Additional context
This same configuration for W3C propagation type works like a charm.

location / {                              
  content_by_lua_block {
    ngx.exec("@otel");                     
  }                                          
}                                       
                               
location @otel {                             
  internal;

  opentelemetry_operation_name apicast; 
  opentelemetry_propagate;                   
  proxy_pass http://example.com;             
}                                            

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 the simplified nginx configuration in the issue and the linked OpenTelemetry Nginx instrumentation. Reproduce the internal redirect with opentelemetry_propagate b3 and compare it with the working W3C configuration. Done means B3 headers are propagated, a new trace starts without a parent, and an existing B3 header is not removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.