opentelemetry-propagator-b3 doesn't allow the receiver to make sampling decision when X-B3-Sampled header is absent

Aperta
#4,793 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

  • #4794 di @vitaly-krugl — chiusa senza merge

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia dalla classe B3MultiFormat e segui come l'estrazione gestisce un carrier senza l'header X-B3-Sampled. La modifica è completa quando un'applicazione può scegliere la decisione di campionamento predefinita del ricevitore, mentre i valori di campionamento B3 espliciti mantengono il comportamento esistente; l'issue fa riferimento alla pull request #4794.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Here is the pull request: #4794

Describe your environment

OS: ALL (Ubuntu, OS X, etc.)
Python version: ALL Python 3x - Python 3.9 and later.
Package version: 1.37.0

What happened?

opentelemetry-propagator-b3 doesn't allow the receiver to make sampling decision when X-B3-Sampled header is absent.

The Zipkin/B3 protocol - https://github.com/openzipkin/b3-propagation - leaves the sampling decision up to the receiver whenever it doesn't receive the "X-B3-Sampled" HTTP header:

An accept sampling decision is encoded as X-B3-Sampled: 1 and a deny as X-B3-Sampled: 0. Absent means defer the decision to the receiver of this header.

However, opentelemetry-propagator-b3 incorrectly hard-codes absent "X-B3-Sampled" as if "X-B3-Sampled: 0", not giving the application an opportunity to make this decision. The class B3MultiFormat does not provide the means for an application to specify it's preference for the default behavior when "X-B3-Sampled" is not received

Steps to Reproduce

Instantiate B3MultiFormat and observe that the class does't offer any parameters or alternate mechanism to specify the default behavior in the event that explicit sampling state (e.g. "X-B3-Sampled") is absent from carrier.

Expected Result

A mechanism in B3MultiFormat to allow the application to decide the desired sampled state in the event that "X-B3-Sampled" is not received.

Actual Result

B3MultiFormat always drops the received "X-B3-TraceId" and "X-B3-SpanId" whenever "X-B3-Sampled" is not received.

This contradicts the Zipkin/B3 protocol specification which explicitly leaves the sampling decision up to the receiver whenever it doesn't receive the "X-B3-Sampled" HTTP header:

An accept sampling decision is encoded as X-B3-Sampled: 1 and a deny as X-B3-Sampled: 0. Absent means defer the decision to the receiver of this header.

Additional context
Would you like to implement a fix?

Yes: Here is the pull request: #4794

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Lingua principale
Python
Stelle
2.7k
Fork
1.1k
Merge medio
3g 12h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-python

Tutte le issue di open-telemetry/opentelemetry-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.