mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
add ability to disable tracing and use nopTracer
Have found some potential performance or stability issues associated with lots of mutex blocking in getting a parent span's context. Want the ability to totally disable tracing to help debugging.
This commit is contained in:
parent
9df46353e7
commit
efd424ebab
3 changed files with 19 additions and 17 deletions
|
|
@ -46,22 +46,24 @@ on the configured port.`,
|
|||
return errors.Wrap(err, "running server")
|
||||
}
|
||||
|
||||
// Initialize tracing in the command since it is global.
|
||||
var cfg jaegercfg.Configuration
|
||||
cfg.ServiceName = "pilosa"
|
||||
cfg.Sampler = &jaegercfg.SamplerConfig{
|
||||
Type: Server.Config.Tracing.SamplerType,
|
||||
Param: Server.Config.Tracing.SamplerParam,
|
||||
if Server.Config.Tracing.SamplerType != "off" {
|
||||
// Initialize tracing in the command since it is global.
|
||||
var cfg jaegercfg.Configuration
|
||||
cfg.ServiceName = "pilosa"
|
||||
cfg.Sampler = &jaegercfg.SamplerConfig{
|
||||
Type: Server.Config.Tracing.SamplerType,
|
||||
Param: Server.Config.Tracing.SamplerParam,
|
||||
}
|
||||
cfg.Reporter = &jaegercfg.ReporterConfig{
|
||||
LocalAgentHostPort: Server.Config.Tracing.AgentHostPort,
|
||||
}
|
||||
tracer, closer, err := cfg.NewTracer()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "initializing jaeger tracer")
|
||||
}
|
||||
defer closer.Close()
|
||||
tracing.GlobalTracer = opentracing.NewTracer(tracer)
|
||||
}
|
||||
cfg.Reporter = &jaegercfg.ReporterConfig{
|
||||
LocalAgentHostPort: Server.Config.Tracing.AgentHostPort,
|
||||
}
|
||||
tracer, closer, err := cfg.NewTracer()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "initializing jaeger tracer")
|
||||
}
|
||||
defer closer.Close()
|
||||
tracing.GlobalTracer = opentracing.NewTracer(tracer)
|
||||
|
||||
return errors.Wrap(Server.Wait(), "waiting on Server")
|
||||
},
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) {
|
|||
|
||||
// Tracing
|
||||
flags.StringVarP(&srv.Config.Tracing.AgentHostPort, "tracing.agent-host-port", "", srv.Config.Tracing.AgentHostPort, "Jaeger agent host:port.")
|
||||
flags.StringVarP(&srv.Config.Tracing.SamplerType, "tracing.sampler-type", "", srv.Config.Tracing.SamplerType, "Jaeger sampler type.")
|
||||
flags.StringVarP(&srv.Config.Tracing.SamplerType, "tracing.sampler-type", "", srv.Config.Tracing.SamplerType, "Jaeger sampler type or 'off' to disable tracing completely.")
|
||||
flags.Float64VarP(&srv.Config.Tracing.SamplerParam, "tracing.sampler-param", "", srv.Config.Tracing.SamplerParam, "Jaeger sampler parameter.")
|
||||
|
||||
// Profiling
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ The config file is in the [toml format](https://github.com/toml-lang/toml) and h
|
|||
|
||||
#### Tracing Sampler Type
|
||||
|
||||
* Description: Jaeger sampler type (const, probabilistic, ratelimiting, or remote)
|
||||
* Description: Jaeger sampler type (const, probabilistic, ratelimiting, or remote). Set to 'off' to disable tracing completely.
|
||||
* Flag: `tracing.sampler-type`
|
||||
* Env: `PILOSA_TRACING_SAMPLER_TYPE`
|
||||
* Config:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue