Minor dependency updates

This commit is contained in:
2023-11-26 01:15:04 -08:00
parent 0a92ad768e
commit 537ee53384
3 changed files with 35 additions and 35 deletions

View File

@@ -1,5 +1,8 @@
package tracing
// todo, review:
// https://github.com/ttys3/tracing-go/blob/main/tracing.go#L136
import (
"context"
"crypto/tls"
@@ -89,13 +92,18 @@ func InitTracer(ctx context.Context, cfg *TracerConfig) (TpShutdownFunc, error)
func newOLTPExporter(ctx context.Context, cfg *TracerConfig) (otelsdktrace.SpanExporter, error) {
logger.Setup().Warn("newOLTPExporter")
opts := []otlptracehttp.Option{otlptracehttp.WithCompression(otlptracehttp.GzipCompression)}
if cfg.CertificateProvider != nil {
logger.Setup().Info("setting up cert provider")
opts = append(opts, otlptracehttp.WithTLSClientConfig(&tls.Config{
GetClientCertificate: cfg.CertificateProvider,
RootCAs: cfg.RootCAs,
}))
} else {
logger.Setup().Info("no cert provider")
}
if len(cfg.Endpoint) > 0 {