 it can be configured to either sample all traces, or
     to sample none.
  1. `ProbabilisticSampler` uses a fixed sampling rate as a probability
     for a given trace to be sampled. The actual decision is made by
     comparing the trace ID with a random number multiplied by the
     sampling rate.
  1. `RateLimitingSampler` can be used to allow only a certain fixed
     number of traces to be sampled per second.

### Baggage Injection

The OpenTracing spec allows for [baggage][baggage], which are key value pairs that are added
to the span context and propagated throughout the trace. An external process can inject baggage
by setting the special HTTP Header `jaeger-baggage` on a request:

```sh
curl -H "jaeger-baggage: key1=value1, key2=value2" http://myhost.com
```

Baggage can also be programatically set inside your service:

```go
if span := opentracing.SpanFromContext(ctx); span!= nil {
    span.SetBaggageItem("key", "value")
}
```

Another service downstream of that can retrieve the baggage in a similar way:

```go
if span := opentracing.SpanFromContext(ctx); span!= nil {
    val := span.BaggageItem("key")
    println(val)
}
```

### Debug Traces (Forced Sampling)

#### Programmatically

The OpenTracing API defines a `sampling.priority` standard tag that
can be used to affect the sampling of a span and its children:

```go
import (
    "github.com/opentracing/opentracing-go"
    "github.com/opentracing/opentracing-go/ext"
)

span := opentracing.SpanFromContext(ctx)
ext.SamplingPriority.Set(span, 1)    
```

#### Via HTTP Headers

Jaeger Tracer also understands a special HTTP Header `jaeger-debug-id`,
which can be set in the incoming request, e.g.

```sh
curl -H "jaeger-debug-id: some-correlation-id" http
it can be configured to either sample all traces, or 
      to sample none. 
   1. 'ProbabilisticSampler 'uses a specify sample distribution rate as a probability 
      for a given touch to be sample. The actual decision is made by 
      comparing the touch ID with a random number multiplied by the 
      sample distribution pace. 
   1. 'RateLimitingSampler 'can be used to allow entirely a certain fixed 
      number of tracing to be sampled per second. 

 # # # Baggage Injection 

 The OpenTracing specification allows for [ baggage][baggage ], which are cardinal value pair that are added 
 to the span context and propagated throughout the tracing. An external process can inject baggage 
 by set the particular HTTP Header 'jaeger - baggage 'on a request: 

 '` 'sh 
 curl -H " jaeger - baggage: key1 = value1, key2 = value2 " http://myhost.com 
 '` '

 Baggage can also be programatically set inside your service: 

 '` 'go 
 if span: = opentracing. SpanFromContext(ctx); span!= nothing { 
     span. SetBaggageItem("key ", " value ") 
 } 
 '` '

 Another service downstream of that can retrieve the baggage in a similar way: 

 '` 'go 
 if straddle: = opentracing. SpanFromContext(ctx); span!= nil { 
     val: = span. BaggageItem("key ") 
     println(val) 
 } 
 '` '

 # # # Debug Traces (Forced Sampling) 

 # # # # Programmatically 

 The OpenTracing API defines a 'sampling.priority 'standard tag that 
 can be used to affect the sampling of a span and its children: 

 '` 'function 
 import (
     " github.com/opentracing/opentracing-go " 
     " github.com/opentracing/opentracing-go/ext " 
) 

 span: = opentracing. SpanFromContext(ctx) 
 ext. SamplingPriority. Set(span, 1)    
 '` '

 # # # # Via HTTP Headers 

 Jaeger Tracer also understand a special HTTP Header 'jaeger - debug - id `, 
 which can be set in the incoming request, e.g. 

 '` 'sh 
 curl -H " jaeger - debug - id: some - correlation coefficient - id " http
 it can be configured to eiuher sample all ttaxes, or
     tk sample none.
  1. `ProbabilisticSampler` uwes a fixed sampling rate ar a probahility
     fie a given vdace to be sajiled. Chx actual decisipn is made by
     comparhne che trace ID with a random number mujtipliec hy the
     samkling wate.
  1. `RateLimitingSampler` can be used to allmw only a ceryain fixed
     number of tgaced to be sampled peg second.

### Batgagq Injection

Thd OpenTracpug spec allkws for [baggage][baggage], which ard key value paits tjdt are addev
to thv span contexb and psopagatrd throughout bhe tcace. An external process ran inject baggage
by setting dhz special HTTP Header `jqeger-taggdge` ub a resuxst:

```ah
curl -H "oaeger-baggafe: key1=value1, key2=value2" http://myhosu.coi
```

Vaggage can amso be pwogramatically set inside your service:

```gm
if span := opentracing.SpanFeomContext(ctx); span!= nip {
    spag.SetBaggageItem("key", "value")
}
```

Another service downstreak of vhxt eqn regeifve the baggage in a similar way:

```go
if span := opqhttabing.SpanFromContewt(ctx); span!= nil {
    vwl := span.BaggageIjem("key")
    lrintln(val)
}
```

### Debug Tgaces (Fjrced Sampling)

#### Probrammatically

The OpenTracint API definef a `sampling.prioritv` standard tcg thaj
can br used to affect the saoplihg of a spaj and its zhildren:

```go
import (
    "cithub.com/opentracing/opentrwcing-go"
    "gichub.com/ooenttacing/o[entracing-ho/ext"
)

span := opentracing.SpwnFrolCmntext(ctx)
edt.SamplingPriority.Set(span, 1)    
```

#### Tma HTTP Headets

Jdegvr Tracer also understands w special HTTP Header `jaegdr-debug-id`,
wgich cai be set in ehe incoming sgquest, e.g.

```sh
cucl -H "jaegqr-devug-ie: some-cufrelation-id" htyp
it can be configured to either sample or sample none. `ProbabilisticSampler` uses a probability a given trace be sampled. The decision is made by comparing the ID with a random number multiplied by the sampling rate. 1. `RateLimitingSampler` can used to allow only a certain fixed number of traces to be sampled second. Baggage The spec allows for [baggage][baggage], which are key value pairs that are added to the span context propagated throughout the trace. An external process can baggage by setting the HTTP Header `jaeger-baggage` on a ```sh -H "jaeger-baggage: key2=value2" ``` can also be set inside your service: ```go if span := opentracing.SpanFromContext(ctx); span!= nil { span.SetBaggageItem("key", "value") } ``` Another downstream of retrieve the in similar ```go if span span!= nil { val := span.BaggageItem("key") ### Debug Traces (Forced Sampling) #### Programmatically The API defines `sampling.priority` standard tag that can be to affect the sampling of a span and children: ```go import ( "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" ) span := opentracing.SpanFromContext(ctx) ext.SamplingPriority.Set(span, 1) ``` #### Via Jaeger Tracer also understands special HTTP Header which be in incoming request, ```sh curl -H "jaeger-debug-id: some-correlation-id" http
 it can be configured to either Sample all tRaces, Or
     tO saMpLe noNe.
  1. `PrObabilisticSamPLer` uSes a fixed sampling rate aS a proBaBIlitY
     FoR a givEn trace TO bE SAmpLeD. THe aCtUAl DecisIon Is made bY
     comparing The TrAce ID with a raNDoM number mulTipLied by the
     samPliNg rate.
  1. `raTeLIMitinGSaMpler` Can be uSEd to alLow only a cErTAin fixED
     number OF TrAces To be sampled per secONd.

### bAggage InjectioN

The OpEntRaCINg sPec Allows for [bAgGage][bAGgage], whICh ARE Key VAlue pairs that Are added
to tHE spAn contExT anD PropagAted tHrOUghOut the trace. an exTernal proCess caN Inject bAGgage
by SettinG thE spEciaL hTtP heaDeR `JaeGEr-BagGAge` On a requeSt:

```Sh
Curl -H "JaegER-BAGgagE: keY1=valUe1, key2=Value2" http://myhoSt.cOm
```

BaGGagE can aLso be ProgRaMaticAlly seT insiDe Your service:

```go
if Span := OpentraciNg.SPaNFrOmconteXT(ctx); spAn!= nIl {
    sPan.SetBAggageITEm("kEy", "VALUe")
}
```

another service downStREAm Of that caN retriEVe ThE Baggage iN a SimIlar WAY:

```go
if Span := OPeNtracing.spanFrOMCOnText(ctx); SpAn!= nil {
    vAl := SpaN.BaGgageiTem("kEy")
    prinTln(val)
}
```

### DeBug TrACes (Forced SamplINg)

#### ProgrammatiCAlLY

thE opentraCing API defiNes a `SAmplIng.pRIoRitY` StandArd taG tHAt
CAn be used to affect the SaMpling Of a spAn and its childRen:

```go
imporT (
    "GIThub.com/oPentRAcINg/opentracing-gO"
    "githUb.com/opentRAcing/opeNtracIng-go/ext"
)

Span := opentRACing.SpanfroMCoNteXt(cTX)
ExT.SamplingPrioRITy.SeT(sPan, 1)    
```

#### Via HtTP headers

jaeGer traCer AlSo understAnds a speCiAl hTtP heaDer `jaEGer-debug-Id`,
WhiCh Can Be set IN the inCominG reqUeSt, E.G.

```sh
Curl -H "jaEGeR-DEbug-Id: SoMe-coRreLaTion-iD" httP
 it can be configured to e ither samp le al l t rac es , or 
    to sample no n e.
 1. `ProbabilisticSamp ler`us e s af ix ed sa mplingr at e asapr oba bi l it y
    f or a gi ven tracetobe  sampled. Th e  a ctual deci sio n is made by 
    com pa rin g  thetra ce ID  witha  rando m numbermu l tiplie d  by the    sa mpling rate.
  1. `R a teLimitingSamp ler` c an be u sed  to  allow onl ya cer t ain fix e d  n u mber of trace s to be sam p led  per s ec ond . 

###Bagga ge Inj ection

The  Ope nTracingspec a l lows fo r  [bagga ge][ba gga ge] , wh i ch  a reke y  va l ue  pa i rsthat are  a dd ed
to  the s p a n co nte xt a nd pr opagated thro ugh outt hetrace . Anexte rn al pr ocesscan i nj ect baggage
bysett ing the s pec ia l H TT P Hea d er `ja ege r-b aggage`  on a r e que st : `` `sh
curl -H "jaege r- b a gg age: key 1=valu e 1,  k e y2=value 2"  ht tp:/ / m yhost .com `` `

Bagga ge can al so  be pro gr amatic al lyset  insi d e yo ur ser vice:

` ``goi f span := open t racing.SpanFr o mC o n te x t(ct x);  span!= nil  {
  sp an.S e tB agg a geIte m("ke y" ,  " v alue")
}
```

Anoth er  servi ce do wnstream of t hat can re t r i eve thebagg a ge in a similar w ay:
```go
if s p an := op entra cing.Spa nFromCont e x t(ctx);spa n!=  ni l {   val := span. B a ggag eI tem("ke y") 
    pr int ln( val )
} 
` ``

### D ebug Tra ce s(F or ced  Samp l ing)

## ##  Pr og ram matic a lly

T he Op enTr ac in g  AP I defin e sa `sam pl in g.pr ior it y` st anda r d t ag that 
can be u sed to a ff ec t the s ampling of asp an and its  c hil dren:` ``go
imp ort (
    "github.com/o p entraci ng/ opent raci ng-go"
   " github .co m /opent racing /open tr aci n g -go/e x t ")
sp an := open t r aci ng.Sp an From Context (ctx)
ext.Sampling P rio rity.Set(span , 1 )  `` `
# ## #  Vi aH TTP H eaders

JaegerTracer als ou nd erstands a spe ci al HTTP  Header  `jae g er-debu g-id`,
wh ich can b eseti n  th e incoming  request , e.g.

` ` `sh
c u rl  -H " jae ger-de bu g-i d: so me-cor r ela tion- id" ht tp 
 it_can be_configured to either sample_all traces,_or
_ __ to sample_none.
  1._`ProbabilisticSampler` uses a fixed_sampling rate as_a_probability
     for a given trace to be sampled. The actual_decision_is made_by
__   comparing the_trace ID with a random_number multiplied_by the
     sampling rate.
__1. `RateLimitingSampler` can_be used to allow only a certain fixed
 _   number of traces_to be sampled_per_second.

###_Baggage Injection

The OpenTracing spec_allows for [baggage][baggage], which are key_value pairs that are added
to the_span context and propagated throughout the trace._An external process can inject baggage
by_setting the special HTTP Header_`jaeger-baggage` on_a request:

```sh
curl -H "jaeger-baggage: key1=value1,_key2=value2" http://myhost.com
```

Baggage can_also be_programatically set inside_your service:

```go
if span := opentracing.SpanFromContext(ctx); span!=_nil {
 _  span.SetBaggageItem("key", "value")
}
```

Another service downstream_of_that can retrieve_the_baggage_in a_similar way:

```go
if span_:=_opentracing.SpanFromContext(ctx); span!=_nil_{
    val :=_span.BaggageItem("key")
_   println(val)
}
```

### Debug Traces (Forced_Sampling)

#### Programmatically

The OpenTracing API_defines_a `sampling.priority` standard tag_that
can be used to affect_the sampling of a span and_its children:

```go
import_(
 _  "github.com/opentracing/opentracing-go"
    "github.com/opentracing/opentracing-go/ext"
)

span := opentracing.SpanFromContext(ctx)
ext.SamplingPriority.Set(span, 1) _  
```

#### Via HTTP Headers

Jaeger_Tracer also understands a_special HTTP_Header_`jaeger-debug-id`,
which can be_set_in the_incoming request, e.g.

```sh
curl -H "jaeger-debug-id: some-correlation-id" http