Skip to content

Commit

Permalink
feat: drop Jaeger support (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tessig authored Sep 10, 2024
1 parent 05ba637 commit 3b88eb8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 38 deletions.
4 changes: 1 addition & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ via `http://localhost:13210/metrics`
| Config | Default Value | Description |
|---------------------------------------------------------------|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `flamingo.opentelemetry.serviceName` | `flamingo` | serviceName is automatically added to all traces as `service.name` attribute |
| `flamingo.opentelemetry.jaeger.enable` | `false` | enables the jaeger exporter <br> :information_source: With Jaeger v1.35 they officially support the OpenTelemetry Protocol, so you can use the OTLP exporter instead. |
| `flamingo.opentelemetry.jaeger.endpoint` | `http://localhost:14268/api/traces` | URL to the jaeger instance |
| `flamingo.opentelemetry.zipkin.enable` | `false` | enables the zipkin exporter |
| `flamingo.opentelemetry.zipkin.endpoint` | `http://localhost:9411/api/v2/spans` | URL to the zipkin instance |
| `flamingo.opentelemetry.otlp.http.enable` | `false` | enables the OTLP HTTP exporter |
Expand Down Expand Up @@ -68,4 +66,4 @@ counter.Add(ctx, 1)
```

For more information about the kinds of metrics and how to use them, please refer to the
official [OpenTelemetry documentation](https://opentelemetry.io/docs/instrumentation/go/manual/#metrics).
official [OpenTelemetry documentation](https://opentelemetry.io/docs/instrumentation/go/manual/#metrics).
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
go.opentelemetry.io/contrib/instrumentation/runtime v0.45.0
go.opentelemetry.io/otel v1.20.0
go.opentelemetry.io/otel/bridge/opencensus v0.42.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.20.0
go.opentelemetry.io/otel/exporters/prometheus v0.42.0
Expand Down
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ cuelang.org/go v0.0.15 h1:rpZtf1ZGYfZwbMHLwIif5Gczil+HF7rHAU7MFNOGV/A=
cuelang.org/go v0.0.15/go.mod h1:gehQASsTv+lFZknWIG0hANGVSBiHD7HyKWmAdEZL3No=
flamingo.me/dingo v0.2.10 h1:FAOsDtKHA+0KmAIdJYzsFNMMOCOMdVX4uAL8JPo6Z8M=
flamingo.me/dingo v0.2.10/go.mod h1:5motgtzS2t26y20nndTLH7tslkBMg4GivTTn+ICQkl8=
flamingo.me/flamingo/v3 v3.9.0 h1:Sk2u3iTnTJulbjg/LXO30m4eanDZrtpi3JoCApaDBtY=
flamingo.me/flamingo/v3 v3.9.0/go.mod h1:Pd+myGr0JLjq95mgWpBPSsh9noDAg9YdXcVwfq6k4gk=
flamingo.me/flamingo/v3 v3.10.1 h1:Dgc0zhqdOOsa/P9Ps2wgNZc2uyZ8WvxjxaZkL602qas=
flamingo.me/flamingo/v3 v3.10.1/go.mod h1:kNoV3wG6edyo0s9WTezuDCa2cZljKOuwv7BvvMxXtDU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down Expand Up @@ -127,8 +125,6 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rbcervilla/redisstore/v9 v9.0.0 h1:wOPbBaydbdxzi1gTafDftCI/Z7vnsXw0QDPCuhiMG0g=
github.com/rbcervilla/redisstore/v9 v9.0.0/go.mod h1:q/acLpoKkTZzIsBYt0R4THDnf8W/BH6GjQYvxDSSfdI=
github.com/redis/go-redis/v9 v9.5.2 h1:L0L3fcSNReTRGyZ6AqAEN0K56wYeYAwapBIhkvh0f3E=
github.com/redis/go-redis/v9 v9.5.2/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4=
github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
Expand All @@ -144,8 +140,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
Expand All @@ -164,8 +158,6 @@ go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc=
go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs=
go.opentelemetry.io/otel/bridge/opencensus v0.42.0 h1:QvC+bcZkWMphWPiVqRQygMj6M0/3TOuJEO+erRA7kI8=
go.opentelemetry.io/otel/bridge/opencensus v0.42.0/go.mod h1:XJojP7g5DqYdiyArix/H9i1XzPPlIUc9dGLKtF9copI=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4=
go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU=
Expand Down
26 changes: 0 additions & 26 deletions module.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
runtimemetrics "go.opentelemetry.io/contrib/instrumentation/runtime"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/bridge/opencensus"
"go.opentelemetry.io/otel/exporters/jaeger" //nolint:staticcheck // todo: migrate
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
"go.opentelemetry.io/otel/exporters/prometheus"
Expand All @@ -32,8 +31,6 @@ import (

type Module struct {
serviceName string
jaegerEnable bool
jaegerEndpoint string
zipkinEnable bool
zipkinEndpoint string
otlpEnableHTTP bool
Expand All @@ -45,8 +42,6 @@ type Module struct {
func (m *Module) Inject(
cfg *struct {
ServiceName string `inject:"config:flamingo.opentelemetry.serviceName"`
JaegerEnable bool `inject:"config:flamingo.opentelemetry.jaeger.enable"`
JaegerEndpoint string `inject:"config:flamingo.opentelemetry.jaeger.endpoint"`
ZipkinEnable bool `inject:"config:flamingo.opentelemetry.zipkin.enable"`
ZipkinEndpoint string `inject:"config:flamingo.opentelemetry.zipkin.endpoint"`
OTLPEnableHTTP bool `inject:"config:flamingo.opentelemetry.otlp.http.enable"`
Expand All @@ -57,8 +52,6 @@ func (m *Module) Inject(
) *Module {
if cfg != nil {
m.serviceName = cfg.ServiceName
m.jaegerEnable = cfg.JaegerEnable
m.jaegerEndpoint = cfg.JaegerEndpoint
m.zipkinEnable = cfg.ZipkinEnable
m.zipkinEndpoint = cfg.ZipkinEndpoint

Expand Down Expand Up @@ -86,7 +79,6 @@ func (m *Module) initTraces() {
const maxTracerProviderOptions = 5
tracerProviderOptions := make([]tracesdk.TracerProviderOption, 0, maxTracerProviderOptions)

tracerProviderOptions = m.initJaeger(tracerProviderOptions)
tracerProviderOptions = m.initOTLP(tracerProviderOptions)
tracerProviderOptions = m.initZipkin(tracerProviderOptions)

Expand Down Expand Up @@ -116,20 +108,6 @@ func (m *Module) initTraces() {
otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
}

func (m *Module) initJaeger(tracerProviderOptions []tracesdk.TracerProviderOption) []tracesdk.TracerProviderOption {
// Create the Jaeger exporter
if m.jaegerEnable {
exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(m.jaegerEndpoint)))
if err != nil {
log.Fatalf("failed to initialze Jeager exporter: %v", err)
}

tracerProviderOptions = append(tracerProviderOptions, tracesdk.WithBatcher(exp))
}

return tracerProviderOptions
}

func (m *Module) initOTLP(tracerProviderOptions []tracesdk.TracerProviderOption) []tracesdk.TracerProviderOption {
// Create the OTLP HTTP exporter
if m.otlpEnableHTTP {
Expand Down Expand Up @@ -225,10 +203,6 @@ func (rt *correlationIDInjector) RoundTrip(req *http.Request) (*http.Response, e
func (m *Module) CueConfig() string {
return `
flamingo: opentelemetry: {
jaeger: {
enable: bool | *false
endpoint: string | *"http://localhost:14268/api/traces"
}
zipkin: {
enable: bool | *false
endpoint: string | *"http://localhost:9411/api/v2/spans"
Expand Down

0 comments on commit 3b88eb8

Please sign in to comment.