mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tracing: Differentiate collector and agent better (#71851)
* differentiate collector and agent better * Add back the max packet size Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> --------- Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
parent
7d347cd428
commit
2bfef9e916
@ -267,10 +267,14 @@ func splitCustomAttribs(s string) ([]attribute.KeyValue, error) {
|
||||
func (ots *Opentelemetry) initJaegerTracerProvider() (*tracesdk.TracerProvider, error) {
|
||||
var ep jaeger.EndpointOption
|
||||
// Create the Jaeger exporter: address can be either agent address (host:port) or collector URL
|
||||
if host, port, err := net.SplitHostPort(ots.Address); err == nil {
|
||||
if strings.HasPrefix(ots.Address, "http://") || strings.HasPrefix(ots.Address, "https://") {
|
||||
ots.log.Debug("using jaeger collector", "address", ots.Address)
|
||||
ep = jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(ots.Address))
|
||||
} else if host, port, err := net.SplitHostPort(ots.Address); err == nil {
|
||||
ots.log.Debug("using jaeger agent", "host", host, "port", port)
|
||||
ep = jaeger.WithAgentEndpoint(jaeger.WithAgentHost(host), jaeger.WithAgentPort(port), jaeger.WithMaxPacketSize(64000))
|
||||
} else {
|
||||
ep = jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(ots.Address))
|
||||
return nil, fmt.Errorf("invalid tracer address: %s", ots.Address)
|
||||
}
|
||||
exp, err := jaeger.New(ep)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user