Merge v2.10 into v3.0

This commit is contained in:
romain 2023-11-29 12:20:57 +01:00
commit e29a142f6a
118 changed files with 1324 additions and 1290 deletions

View file

@ -48,7 +48,7 @@ func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error
logger := log.With().Str(logs.TracingProviderName, Name).Logger()
opts := []datadog.StartOption{
datadog.WithServiceName(serviceName),
datadog.WithService(serviceName),
datadog.WithDebugMode(c.Debug),
datadog.WithPropagator(datadog.NewPropagator(&datadog.PropagatorConfig{
TraceHeader: c.TraceIDHeaderName,

View file

@ -2,7 +2,7 @@ package tracing
import (
"crypto/sha256"
"fmt"
"encoding/hex"
"strings"
"github.com/rs/zerolog/log"
@ -61,5 +61,5 @@ func computeHash(name string) string {
log.Error().Str("OperationName", name).Err(err).Msgf("Failed to create Span name hash for %s", name)
}
return fmt.Sprintf("%x", hash.Sum(nil))[:TraceNameHashLength]
return hex.EncodeToString(hash.Sum(nil))[:TraceNameHashLength]
}

View file

@ -129,7 +129,7 @@ func TestTruncateString(t *testing.T) {
actual := truncateString(test.text, test.limit)
assert.Equal(t, test.expected, actual)
assert.True(t, len(actual) <= test.limit)
assert.LessOrEqual(t, len(actual), test.limit)
})
}
}