New static configuration loading system.
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
parent
d18edd6f77
commit
8d7eccad5d
165 changed files with 10894 additions and 6076 deletions
|
@ -15,14 +15,22 @@ const Name = "datadog"
|
|||
|
||||
// Config provides configuration settings for a datadog tracer
|
||||
type Config struct {
|
||||
LocalAgentHostPort string `description:"Set datadog-agent's host:port that the reporter will used. Defaults to localhost:8126" export:"false"`
|
||||
LocalAgentHostPort string `description:"Set datadog-agent's host:port that the reporter will used." export:"false"`
|
||||
GlobalTag string `description:"Key:Value tag to be set on all the spans." export:"true"`
|
||||
Debug bool `description:"Enable DataDog debug." export:"true"`
|
||||
PrioritySampling bool `description:"Enable priority sampling. When using distributed tracing, this option must be enabled in order to get all the parts of a distributed trace sampled."`
|
||||
TraceIDHeaderName string `description:"Specifies the header name that will be used to store the trace ID." export:"true"`
|
||||
ParentIDHeaderName string `description:"Specifies the header name that will be used to store the parent ID." export:"true"`
|
||||
SamplingPriorityHeaderName string `description:"Specifies the header name that will be used to store the sampling priority." export:"true"`
|
||||
BagagePrefixHeaderName string `description:"specifies the header name prefix that will be used to store baggage items in a map." export:"true"`
|
||||
BagagePrefixHeaderName string `description:"Specifies the header name prefix that will be used to store baggage items in a map." export:"true"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
func (c *Config) SetDefaults() {
|
||||
c.LocalAgentHostPort = "localhost:8126"
|
||||
c.GlobalTag = ""
|
||||
c.Debug = false
|
||||
c.PrioritySampling = false
|
||||
}
|
||||
|
||||
// Setup sets up the tracer
|
||||
|
|
|
@ -15,15 +15,21 @@ const Name = "haystack"
|
|||
|
||||
// Config provides configuration settings for a haystack tracer
|
||||
type Config struct {
|
||||
LocalAgentHost string `description:"Set haystack-agent's host that the reporter will used. Defaults to localhost" export:"false"`
|
||||
LocalAgentPort int `description:"Set haystack-agent's port that the reporter will used. Defaults to 35000" export:"false"`
|
||||
LocalAgentHost string `description:"Set haystack-agent's host that the reporter will used." export:"false"`
|
||||
LocalAgentPort int `description:"Set haystack-agent's port that the reporter will used." export:"false"`
|
||||
GlobalTag string `description:"Key:Value tag to be set on all the spans." export:"true"`
|
||||
TraceIDHeaderName string `description:"Specifies the header name that will be used to store the trace ID.." export:"true"`
|
||||
TraceIDHeaderName string `description:"Specifies the header name that will be used to store the trace ID." export:"true"`
|
||||
ParentIDHeaderName string `description:"Specifies the header name that will be used to store the parent ID." export:"true"`
|
||||
SpanIDHeaderName string `description:"Specifies the header name that will be used to store the span ID." export:"true"`
|
||||
BaggagePrefixHeaderName string `description:"specifies the header name prefix that will be used to store baggage items in a map." export:"true"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
func (c *Config) SetDefaults() {
|
||||
c.LocalAgentHost = "LocalAgentHost"
|
||||
c.LocalAgentPort = 35000
|
||||
}
|
||||
|
||||
// Setup sets up the tracer
|
||||
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
|
||||
tag := strings.SplitN(c.GlobalTag, ":", 2)
|
||||
|
|
|
@ -18,6 +18,13 @@ type Config struct {
|
|||
LogLevel string `description:"Set instana-agent's log level. ('error','warn','info','debug')" export:"false"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
func (c *Config) SetDefaults() {
|
||||
c.LocalAgentHost = "localhost"
|
||||
c.LocalAgentPort = 42699
|
||||
c.LogLevel = "info"
|
||||
}
|
||||
|
||||
// Setup sets up the tracer
|
||||
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
|
||||
// set default logLevel
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/containous/traefik/pkg/log"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
jaeger "github.com/uber/jaeger-client-go"
|
||||
jaegercli "github.com/uber/jaeger-client-go"
|
||||
jaegercfg "github.com/uber/jaeger-client-go/config"
|
||||
"github.com/uber/jaeger-client-go/zipkin"
|
||||
jaegermet "github.com/uber/jaeger-lib/metrics"
|
||||
|
@ -17,13 +18,24 @@ const Name = "jaeger"
|
|||
|
||||
// Config provides configuration settings for a jaeger tracer
|
||||
type Config struct {
|
||||
SamplingServerURL string `description:"set the sampling server url." export:"false"`
|
||||
SamplingType string `description:"set the sampling type." export:"true"`
|
||||
SamplingParam float64 `description:"set the sampling parameter." export:"true"`
|
||||
LocalAgentHostPort string `description:"set jaeger-agent's host:port that the reporter will used." export:"false"`
|
||||
Gen128Bit bool `description:"generate 128 bit span IDs." export:"true"`
|
||||
Propagation string `description:"which propgation format to use (jaeger/b3)." export:"true"`
|
||||
TraceContextHeaderName string `description:"set the header to use for the trace-id." export:"true"`
|
||||
SamplingServerURL string `description:"Set the sampling server url." export:"false"`
|
||||
SamplingType string `description:"Set the sampling type." export:"true"`
|
||||
SamplingParam float64 `description:"Set the sampling parameter." export:"true"`
|
||||
LocalAgentHostPort string `description:"Set jaeger-agent's host:port that the reporter will used." export:"false"`
|
||||
Gen128Bit bool `description:"Generate 128 bit span IDs." export:"true"`
|
||||
Propagation string `description:"Which propgation format to use (jaeger/b3)." export:"true"`
|
||||
TraceContextHeaderName string `description:"Set the header to use for the trace-id." export:"true"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
func (c *Config) SetDefaults() {
|
||||
c.SamplingServerURL = "http://localhost:5778/sampling"
|
||||
c.SamplingType = "const"
|
||||
c.SamplingParam = 1.0
|
||||
c.LocalAgentHostPort = "127.0.0.1:6831"
|
||||
c.Propagation = "jaeger"
|
||||
c.Gen128Bit = false
|
||||
c.TraceContextHeaderName = jaegercli.TraceContextHeaderName
|
||||
}
|
||||
|
||||
// Setup sets up the tracer
|
||||
|
|
|
@ -21,6 +21,15 @@ type Config struct {
|
|||
SampleRate float64 `description:"The rate between 0.0 and 1.0 of requests to trace." export:"true"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
func (c *Config) SetDefaults() {
|
||||
c.HTTPEndpoint = "http://localhost:9411/api/v1/spans"
|
||||
c.SameSpan = false
|
||||
c.ID128Bit = true
|
||||
c.Debug = false
|
||||
c.SampleRate = 1.0
|
||||
}
|
||||
|
||||
// Setup sets up the tracer
|
||||
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
|
||||
collector, err := zipkin.NewHTTPCollector(c.HTTPEndpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue