diff --git a/README.md b/README.md
index f4e1104..1ae572a 100755
--- a/README.md
+++ b/README.md
@@ -112,7 +112,7 @@ const SupportPackageIsVersion1 = true
```
-## func [ConfigureInterceptors]()
+## func [ConfigureInterceptors]()
```go
func ConfigureInterceptors(DoNotLogGRPCReflection bool, traceHeaderName string)
@@ -121,7 +121,7 @@ func ConfigureInterceptors(DoNotLogGRPCReflection bool, traceHeaderName string)
ConfigureInterceptors configures the interceptors package with the provided DoNotLogGRPCReflection is a boolean that indicates whether to log the grpc.reflection.v1alpha.ServerReflection service calls in logs traceHeaderName is the name of the header to use for tracing \(e.g. X\-Trace\-Id\) \- if empty, defaults to X\-Trace\-Id
-## func [InitializeVTProto]()
+## func [InitializeVTProto]()
```go
func InitializeVTProto()
@@ -132,7 +132,7 @@ InitializeVTProto initializes the vtproto package for use with the service
https://github.com/planetscale/vtprotobuf?tab=readme-ov-file#mixing-protobuf-implementations-with-grpc
-## func [SetupAutoMaxProcs]()
+## func [SetupAutoMaxProcs]()
```go
func SetupAutoMaxProcs()
@@ -141,7 +141,7 @@ func SetupAutoMaxProcs()
SetupAutoMaxProcs sets up the GOMAXPROCS to match Linux container CPU quota This is used to set the GOMAXPROCS to the number of CPUs allocated to the container
-## func [SetupEnvironment]()
+## func [SetupEnvironment]()
```go
func SetupEnvironment(env string)
@@ -150,7 +150,7 @@ func SetupEnvironment(env string)
SetupEnvironment sets the environment This is used to identify the environment in Sentry and New Relic env is the environment to set for the service \(e.g. prod, staging, dev\)
-## func [SetupHystrixPrometheus]()
+## func [SetupHystrixPrometheus]()
```go
func SetupHystrixPrometheus()
@@ -159,7 +159,7 @@ func SetupHystrixPrometheus()
SetupHystrixPrometheus sets up the hystrix metrics This is a workaround for hystrix\-go not supporting the prometheus registry It uses sync.Once to ensure the Prometheus collectors are only registered once, since duplicate registration panics.
-## func [SetupLogger]()
+## func [SetupLogger]()
```go
func SetupLogger(logLevel string, jsonlogs bool) error
@@ -168,7 +168,7 @@ func SetupLogger(logLevel string, jsonlogs bool) error
SetupLogger sets up the logger It uses the coldbrew logger to log messages to stdout logLevel is the log level to set for the logger jsonlogs is a boolean to enable or disable json logs
-## func [SetupNROpenTelemetry]()
+## func [SetupNROpenTelemetry]()
```go
func SetupNROpenTelemetry(serviceName, license, version string, ratio float64) error
@@ -186,7 +186,7 @@ Parameters:
- ratio: the sampling ratio to use for traces \(0.0 to 1.0\)
-## func [SetupNewRelic]()
+## func [SetupNewRelic]()
```go
func SetupNewRelic(serviceName, apiKey string, tracing bool) error
@@ -195,7 +195,7 @@ func SetupNewRelic(serviceName, apiKey string, tracing bool) error
SetupNewRelic sets up the New Relic tracing and monitoring agent for the service It uses the New Relic Go Agent to send traces to New Relic One APM and Insights serviceName is the name of the service apiKey is the New Relic license key tracing is a boolean to enable or disable tracing
-## func [SetupOpenTelemetry]()
+## func [SetupOpenTelemetry]()
```go
func SetupOpenTelemetry(config OTLPConfig) error
@@ -233,7 +233,7 @@ err := SetupOpenTelemetry(config)
```
-## func [SetupReleaseName]()
+## func [SetupReleaseName]()
```go
func SetupReleaseName(rel string)
@@ -242,7 +242,7 @@ func SetupReleaseName(rel string)
SetupReleaseName sets the release name This is used to identify the release in Sentry rel is the release name to set for the service \(e.g. v1.0.0\)
-## func [SetupSentry]()
+## func [SetupSentry]()
```go
func SetupSentry(dsn string)
@@ -272,7 +272,7 @@ type CB interface {
```
-### func [New]()
+### func [New]()
```go
func New(c config.Config) CB
@@ -325,7 +325,7 @@ type CBStopper interface {
```
-## type [OTLPConfig]()
+## type [OTLPConfig]()
OTLPConfig holds configuration for OpenTelemetry OTLP exporter
diff --git a/core.go b/core.go
index d7bbe55..c2a6468 100644
--- a/core.go
+++ b/core.go
@@ -87,7 +87,7 @@ func parseHeaders(headerString string) map[string]string {
return headers
}
-// processConfig processes the config and sets up the logger, newrelic, sentry, environment, release name, jaeger, hystrix prometheus and signal handler
+// processConfig processes the config and sets up the logger, newrelic, sentry, environment, release name, OpenTelemetry tracing, hystrix prometheus and signal handler
func (c *cb) processConfig() {
if err := SetupLogger(c.config.LogLevel, c.config.JSONLogs); err != nil {
log.Error(context.Background(), "msg", "failed to setup logger", "err", err)
@@ -112,10 +112,6 @@ func (c *cb) processConfig() {
SetupSentry(c.config.SentryDSN)
SetupEnvironment(c.config.Environment)
SetupReleaseName(c.config.ReleaseName)
- cls := setupJaeger(c.config.AppName)
- if cls != nil {
- c.closers = append(c.closers, cls)
- }
SetupHystrixPrometheus()
ConfigureInterceptors(c.config.DoNotLogGRPCReflection, c.config.TraceHeaderName)
if !c.config.DisableSignalHandler {
diff --git a/go.mod b/go.mod
index d4fcea0..434b2c8 100644
--- a/go.mod
+++ b/go.mod
@@ -14,12 +14,10 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0
- github.com/jaegertracing/jaeger-lib v2.4.1+incompatible
github.com/klauspost/compress v1.18.5
github.com/newrelic/go-agent/v3 v3.42.0
github.com/opentracing/opentracing-go v1.2.0
github.com/prometheus/client_golang v1.23.2
- github.com/uber/jaeger-client-go v2.30.0+incompatible
go.opentelemetry.io/otel v1.42.0
go.opentelemetry.io/otel/bridge/opentracing v1.42.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0
@@ -47,7 +45,6 @@ require (
github.com/Antonboom/testifylint v1.6.4 // indirect
github.com/BurntSushi/toml v1.6.0 // indirect
github.com/Djarvur/go-err113 v0.1.1 // indirect
- github.com/HdrHistogram/hdrhistogram-go v1.2.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/MirrexOne/unqueryvet v1.5.4 // indirect
@@ -247,7 +244,6 @@ require (
github.com/timonwong/loggercheck v0.11.0 // indirect
github.com/tomarrell/wrapcheck/v2 v2.12.0 // indirect
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
- github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/ultraware/funlen v0.2.0 // indirect
github.com/ultraware/whitespace v0.2.0 // indirect
github.com/uudashr/gocognit v1.2.1 // indirect
@@ -268,7 +264,6 @@ require (
go.opentelemetry.io/otel/metric v1.42.0 // indirect
go.opentelemetry.io/otel/trace v1.42.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
- go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
diff --git a/go.sum b/go.sum
index 4b7e511..a55c6fa 100644
--- a/go.sum
+++ b/go.sum
@@ -32,8 +32,6 @@ github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/Djarvur/go-err113 v0.1.1 h1:eHfopDqXRwAi+YmCUas75ZE0+hoBHJ2GQNLYRSxao4g=
github.com/Djarvur/go-err113 v0.1.1/go.mod h1:IaWJdYFLg76t2ihfflPZnM1LIQszWOsFDh2hhhAVF6k=
-github.com/HdrHistogram/hdrhistogram-go v1.2.0 h1:XMJkDWuz6bM9Fzy7zORuVFKH7ZJY41G2q8KWhVGkNiY=
-github.com/HdrHistogram/hdrhistogram-go v1.2.0/go.mod h1:CiIeGiHSd06zjX+FypuEJ5EQ07KKtxZ+8J6hszwVQig=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
@@ -340,8 +338,6 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/jaegertracing/jaeger-lib v2.4.1+incompatible h1:T+iarSGas1APzunL/14yHIHVyNDi3WK0Xvo8RQu5MT8=
-github.com/jaegertracing/jaeger-lib v2.4.1+incompatible/go.mod h1:VqeqQrZmZr9G4WdLw4ei9tAHU54iJRkfoFHvTTQn4jQ=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jgautheron/goconst v1.8.2 h1:y0XF7X8CikZ93fSNT6WBTb/NElBu9IjaY7CCYQrCMX4=
@@ -622,10 +618,6 @@ github.com/tomarrell/wrapcheck/v2 v2.12.0 h1:H/qQ1aNWz/eeIhxKAFvkfIA+N7YDvq6TWVF
github.com/tomarrell/wrapcheck/v2 v2.12.0/go.mod h1:AQhQuZd0p7b6rfW+vUwHm5OMCGgp63moQ9Qr/0BpIWo=
github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw=
github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=
-github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=
-github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
-github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
-github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI=
github.com/ultraware/funlen v0.2.0/go.mod h1:ZE0q4TsJ8T1SQcjmkhN/w+MceuatI6pBFSxxyteHIJA=
github.com/ultraware/whitespace v0.2.0 h1:TYowo2m9Nfj1baEQBjuHzvMRbp19i+RCcRYrSWoFa+g=
@@ -688,8 +680,6 @@ go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhn
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
-go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
diff --git a/initializers.go b/initializers.go
index f1a3b9f..942a824 100644
--- a/initializers.go
+++ b/initializers.go
@@ -3,7 +3,6 @@ package core
import (
"context"
"fmt"
- "io"
"os"
"os/signal"
"strings"
@@ -20,12 +19,9 @@ import (
cbslog "github.com/go-coldbrew/log/loggers/slog"
nrutil "github.com/go-coldbrew/tracing/newrelic"
protov1 "github.com/golang/protobuf/proto" //nolint:staticcheck
- jprom "github.com/jaegertracing/jaeger-lib/metrics/prometheus"
newrelic "github.com/newrelic/go-agent/v3/newrelic"
"github.com/opentracing/opentracing-go"
"github.com/prometheus/client_golang/prometheus"
- jaegerconfig "github.com/uber/jaeger-client-go/config"
- "github.com/uber/jaeger-client-go/zipkin"
"go.opentelemetry.io/otel"
otelBridge "go.opentelemetry.io/otel/bridge/opentracing"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
@@ -109,40 +105,6 @@ func SetupReleaseName(rel string) {
}
}
-// setupJaeger sets up the Jaeger tracing.
-// It uses the Jaeger Zipkin B3 HTTP Propagator to propagate the tracing headers to downstream services.
-//
-// Deprecated: The Jaeger client (github.com/uber/jaeger-client-go) is EOL.
-// Use SetupOpenTelemetry or SetupNROpenTelemetry instead, which support
-// OTLP-compatible backends including Jaeger's OTLP receiver.
-func setupJaeger(serviceName string) io.Closer {
- conf, err := jaegerconfig.FromEnv()
- if err != nil {
- log.Info(context.Background(), "msg", "could not initialize jaeger", "err", err)
- return nil
- }
- if conf.ServiceName == "" && serviceName == "" {
- // Jaeger not configured, skip initialization
- return nil
- }
- log.Warn(context.Background(), "msg", "Jaeger client is deprecated and EOL. Please migrate to SetupOpenTelemetry or SetupNROpenTelemetry with OTLP-compatible backends.")
- conf.ServiceName = serviceName
- zipkinPropagator := zipkin.NewZipkinB3HTTPHeaderPropagator()
- jaegerTracer, closer, err := conf.NewTracer(
- jaegerconfig.Injector(opentracing.HTTPHeaders, zipkinPropagator),
- jaegerconfig.Extractor(opentracing.HTTPHeaders, zipkinPropagator),
- jaegerconfig.ZipkinSharedRPCSpan(true),
- jaegerconfig.Metrics(jprom.New()),
- )
- if err != nil {
- log.Info(context.Background(), "msg", "could not initialize jaeger", "err", err)
- return nil
- }
- opentracing.SetGlobalTracer(jaegerTracer)
- log.Info(context.Background(), "msg", "jaeger tracing initialized")
- return closer
-}
-
// OTLPConfig holds configuration for OpenTelemetry OTLP exporter
//
// This struct provides a flexible way to configure OpenTelemetry tracing