Documentation
¶
Overview ¶
Package zipkin provides implementation for zipkin plugin.
Index ¶
- Constants
- func ClientFilter(z *zipkinPlugin) filter.ClientFilter
- func ServerFilter(z *zipkinPlugin) filter.ServerFilter
- type BoundarySamplerConfig
- type Config
- type CountingSamplerConfig
- type HTTPReporterConfig
- type KafkaProducerFlushConfig
- type KafkaReporterConfig
- type ModuloSamplerConfig
- type NoopReporterConfig
- type ReporterConfig
- type SamplerConfig
Constants ¶
const ( NeverSampler = "never" AlwaysSampler = "always" ModuloSampler = "modulo" BoundarySampler = "boundary" CountingSampler = "counting" HTTPReporter = "http" KafkaReporter = "kafka" NoopReporter = "noop" )
Zipkin plugin constants.
Variables ¶
This section is empty.
Functions ¶
func ClientFilter ¶
func ClientFilter(z *zipkinPlugin) filter.ClientFilter
ClientFilter returns a distributed tracing filter for RPC client
func ServerFilter ¶
func ServerFilter(z *zipkinPlugin) filter.ServerFilter
ServerFilter returns a distributed tracing filter for RPC server
Types ¶
type BoundarySamplerConfig ¶
BoundarySamplerConfig holds the configuration for boundary sampler
type Config ¶
type Config struct { ServiceName string `yaml:"service_name"` HostPort string `yaml:"host_port"` TraceID128 bool `yaml:"trace_id_128"` Sampler *SamplerConfig `yaml:"sampler"` Reporter *ReporterConfig `yaml:"reporter"` }
Config holds the configuration
func (*Config) NewOpenTracingTracer ¶
NewOpenTracingTracer news a opentracing tracer
func (*Config) NewZipkinTracer ¶
NewZipkinTracer news a zipkin tracer
type CountingSamplerConfig ¶
type CountingSamplerConfig struct {
Rate float64 `yaml:"rate"`
}
CountingSamplerConfig holds the configuration for counting sampler
type HTTPReporterConfig ¶
type HTTPReporterConfig struct { Url string `yaml:"url"` TimeoutSeconds int `yaml:"time_out_seconds"` BatchIntervalSeconds int `yaml:"batch_interval_seconds"` BatchSize int `yaml:"batch_size"` MaxBacklog int `yaml:"max_backlog"` }
HTTPReporterConfig holds the configuration for http reporter defaultTimeout = time.Second * 5 // timeout for http request in seconds defaultBatchInterval = time.Second * 1 // BatchInterval in seconds defaultBatchSize = 100 defaultMaxBacklog = 1000
type KafkaProducerFlushConfig ¶
type KafkaProducerFlushConfig struct { // The best-effort number of bytes needed to trigger a flush. Use the // global sarama.MaxRequestSize to set a hard upper limit. Bytes int `yaml:"bytes"` // The best-effort number of messages needed to trigger a flush. Use // `MaxMessages` to set a hard upper limit. Messages int `yaml:"messages"` // The best-effort frequency of flushes. Equivalent to // `queue.buffering.max.ms` setting of JVM producer. Frequency time.Duration `yaml:"frequency"` // The maximum number of messages the producer will send in a single // broker request. Defaults to 0 for unlimited. Similar to // `queue.buffering.max.messages` in the JVM producer. MaxMessages int `yaml:"max_messages"` }
KafkaProducerFlushConfig holds the configuration for kafka producer
type KafkaReporterConfig ¶
type KafkaReporterConfig struct { Urls []string `yaml:"urls"` ProducerFlushConfig *KafkaProducerFlushConfig `yaml:"producer_flush_config"` }
KafkaReporterConfig holds the configuration for kafka reporter
type ModuloSamplerConfig ¶
type ModuloSamplerConfig struct {
Mod uint64 `yaml:"mod"`
}
ModuloSamplerConfig holds the configuration for modulo sampler
type NoopReporterConfig ¶
type NoopReporterConfig struct { }
NoopReporterConfig holds the configuration for noop reporter
type ReporterConfig ¶
type ReporterConfig struct { Type string `yaml:"type"` HTTP *HTTPReporterConfig `yaml:"http"` Kafka *KafkaReporterConfig `yaml:"kafka"` }
ReporterConfig holds the configuration for reporter
type SamplerConfig ¶
type SamplerConfig struct { // Type can be: Never Always Modulo Boundary Counting Type string `yaml:"type"` // Modulo sampler Modulo *ModuloSamplerConfig `yaml:"const"` // Boundary sampler Boundary *BoundarySamplerConfig `yaml:"mix"` // Counting sampler Counting *CountingSamplerConfig `yaml:"counting"` }
SamplerConfig holds the sampler configuration