Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [Jaeger] Add gRPC sampling endpoint (#3490) #3497

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

simitt
Copy link
Contributor

@simitt simitt commented Mar 18, 2020

Backports the following commits to 7.x:

Support fetching Jaeger gRPC sampling strategy from APM
server. Only probabilistic sampling is supported. Sampling
rates are configured via Kibana agent config management.

implements elastic#3487
@codecov-io
Copy link

Codecov Report

Merging #3497 into 7.x will increase coverage by 0.24%.
The diff coverage is 96.38%.

@@            Coverage Diff             @@
##              7.x    #3497      +/-   ##
==========================================
+ Coverage   78.98%   79.22%   +0.24%     
==========================================
  Files         109      109              
  Lines        5724     5782      +58     
==========================================
+ Hits         4521     4581      +60     
+ Misses       1203     1201       -2     
Impacted Files Coverage Δ
agentcfg/model.go 100.00% <ø> (+11.76%) ⬆️
beater/jaeger/common.go 78.78% <ø> (-6.07%) ⬇️
beater/jaeger/grpc.go 94.82% <94.33%> (-5.18%) ⬇️
agentcfg/fetch.go 90.00% <100.00%> (+1.42%) ⬆️
beater/api/config/agent/handler.go 95.00% <100.00%> (+0.08%) ⬆️
beater/jaeger/server.go 81.81% <100.00%> (+2.10%) ⬆️
processor/otel/consumer.go 92.83% <100.00%> (ø)
kibana/connecting_client.go 72.58% <0.00%> (+8.06%) ⬆️

@simitt simitt merged commit 073dda6 into elastic:7.x Mar 18, 2020
@simitt simitt deleted the backport/7.x/pr-3490 branch March 18, 2020 16:41
@axw axw self-assigned this Mar 30, 2020
@axw
Copy link
Member

axw commented Mar 31, 2020

Verified with this program:

package main                                                                            
                                                                                        
import (                                                                                
        "fmt"                                                                           
        "time"                                                                          
                                                                                        
        "github.com/uber/jaeger-client-go"                                              
        "github.com/uber/jaeger-client-go/config"                                       
)                                                                                       
                                                                                        
func main() {                                                                           
        cfg, _ := config.FromEnv()                                                                                                                              
        cfg.ServiceName = "schnozz"                                                     
        cfg.Sampler.Type = "remote"                                                     
        cfg.Sampler.Param = 0.1                                                         
        cfg.Sampler.SamplingRefreshInterval = 250 * time.Millisecond                    
                                                                                        
        tracer, _, _ := cfg.NewTracer()                                                                                                                                       
        for {                                                                           
                span := tracer.StartSpan("frozzle")                                     
                fmt.Println("sampled:", span.Context().(jaeger.SpanContext).IsSampled())
                span.Finish()                                                           
                time.Sleep(100 * time.Millisecond)                                      
        }
}

Process starts out sending transactions with 10% probability, and eventually picks up the remote config. However, I did notice that the indicator remains grey, as we never mark the config as applied. Something to look into for next iteration, opened #3579.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants