add kindJaegerUdp

This commit is contained in:
xiandong
2023-02-17 12:58:31 +08:00
committed by kevin
parent 21566f1b7a
commit 77a72b16e9
3 changed files with 38 additions and 5 deletions

View File

@@ -1,5 +1,9 @@
package trace
import (
"strings"
)
// TraceName represents the tracing name.
const TraceName = "go-zero"
@@ -8,5 +12,22 @@ type Config struct {
Name string `json:",optional"`
Endpoint string `json:",optional"`
Sampler float64 `json:",default=1.0"`
Batcher string `json:",default=jaeger,options=jaeger|zipkin|otlpgrpc|otlphttp"`
Batcher string `json:",default=jaeger,options=jaeger|jaegerudp|zipkin|otlpgrpc|otlphttp"`
}
func (c *Config) getEndpointHost() string {
EndpointSlice := strings.Split(c.Endpoint, ":")
if len(EndpointSlice) > 0 {
return strings.TrimSpace(EndpointSlice[0])
}
return ""
}
func (c *Config) getEndpointPort() string {
EndpointSlice := strings.Split(c.Endpoint, ":")
if len(EndpointSlice) > 1 {
return strings.TrimSpace(EndpointSlice[1])
}
return ""
}