feat: 添加高级配置选项,增强追踪提供者功能,支持采样器、Reporter 和标签配置
This commit is contained in:
@@ -34,6 +34,25 @@ type Config struct {
|
||||
Name string
|
||||
Reporter_LocalAgentHostPort string //: "127.0.0.1:6831",
|
||||
Reporter_CollectorEndpoint string //: "http://127.0.0.1:14268/api/traces",
|
||||
Disabled bool
|
||||
Gen128Bit bool
|
||||
ZipkinSharedRPCSpan bool
|
||||
RPCMetrics bool
|
||||
|
||||
// Sampler configuration
|
||||
Sampler_Type string
|
||||
Sampler_Param float64
|
||||
Sampler_SamplingServerURL string
|
||||
Sampler_MaxOperations int
|
||||
Sampler_RefreshIntervalSec uint
|
||||
|
||||
// Reporter configuration
|
||||
Reporter_LogSpans *bool
|
||||
Reporter_BufferFlushMs uint
|
||||
Reporter_QueueSize int
|
||||
|
||||
// Process tags
|
||||
Tags map[string]string
|
||||
}
|
||||
|
||||
func (c *Config) format() {
|
||||
@@ -48,4 +67,21 @@ func (c *Config) format() {
|
||||
if c.Name == "" {
|
||||
c.Name = "default"
|
||||
}
|
||||
|
||||
if c.Sampler_Type == "" {
|
||||
c.Sampler_Type = "const"
|
||||
}
|
||||
if c.Sampler_Param == 0 {
|
||||
c.Sampler_Param = 1
|
||||
}
|
||||
if c.Reporter_BufferFlushMs == 0 {
|
||||
c.Reporter_BufferFlushMs = 100
|
||||
}
|
||||
if c.Reporter_QueueSize == 0 {
|
||||
c.Reporter_QueueSize = 1000
|
||||
}
|
||||
if c.Reporter_LogSpans == nil {
|
||||
b := true
|
||||
c.Reporter_LogSpans = &b
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user