diff options
author | 2023-09-07 13:20:37 +0200 | |
---|---|---|
committer | 2023-09-07 13:20:37 +0200 | |
commit | 14ef09809942800db57de87fe3963770a56b585b (patch) | |
tree | 89e95f21145bc7ad5745f77be1d998faa9c09695 /internal | |
parent | [bugfix] fix checks for deref the same status descendants / ascendants (#2181) (diff) | |
download | gotosocial-14ef09809942800db57de87fe3963770a56b585b.tar.xz |
[feature] Support OTLP HTTP, drop Jaeger (#2184)
* [feature] Add http trace exporter, drop Jaeger
Jaeger supports ingesting traces using the OpenTelemetry gRPC or HTTP
methods. The Jaeger project has deprecated the old jaeger transport.
* Add support for submitting traces over HTTP
* Drop support for the old Jaeger protocol
* Upgrade the trace libraries to v1.17
Fixes: #2176
Fixes: #2179
Diffstat (limited to 'internal')
-rw-r--r-- | internal/config/config.go | 6 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 2 | ||||
-rw-r--r-- | internal/tracing/tracing.go | 12 |
3 files changed, 13 insertions, 7 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 5da226237..16ef32a8b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -131,9 +131,9 @@ type Configuration struct { OIDCAdminGroups []string `name:"oidc-admin-groups" usage:"Membership of one of the listed groups makes someone a GtS admin"` TracingEnabled bool `name:"tracing-enabled" usage:"Enable OTLP Tracing"` - TracingTransport string `name:"tracing-transport" usage:"grpc or jaeger"` - TracingEndpoint string `name:"tracing-endpoint" usage:"Endpoint of your trace collector. Eg., 'localhost:4317' for gRPC, 'http://localhost:14268/api/traces' for jaeger"` - TracingInsecureTransport bool `name:"tracing-insecure" usage:"Disable HTTPS for the gRPC transport protocol"` + TracingTransport string `name:"tracing-transport" usage:"grpc or http"` + TracingEndpoint string `name:"tracing-endpoint" usage:"Endpoint of your trace collector. Eg., 'localhost:4317' for gRPC, 'localhost:4318' for http"` + TracingInsecureTransport bool `name:"tracing-insecure-transport" usage:"Disable TLS for the gRPC or HTTP transport protocol"` SMTPHost string `name:"smtp-host" usage:"Host of the smtp server. Eg., 'smtp.eu.mailgun.org'"` SMTPPort int `name:"smtp-port" usage:"Port of the smtp server. Eg., 587"` diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index a515da200..f232d37a3 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -1991,7 +1991,7 @@ func (st *ConfigState) SetTracingInsecureTransport(v bool) { } // TracingInsecureTransportFlag returns the flag name for the 'TracingInsecureTransport' field -func TracingInsecureTransportFlag() string { return "tracing-insecure" } +func TracingInsecureTransportFlag() string { return "tracing-insecure-transport" } // GetTracingInsecureTransport safely fetches the value for global configuration 'TracingInsecureTransport' field func GetTracingInsecureTransport() bool { return global.GetTracingInsecureTransport() } diff --git a/internal/tracing/tracing.go b/internal/tracing/tracing.go index 16e5a5eb5..a0b25f487 100644 --- a/internal/tracing/tracing.go +++ b/internal/tracing/tracing.go @@ -29,8 +29,8 @@ import ( "github.com/uptrace/bun/extra/bunotel" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" "go.opentelemetry.io/otel/sdk/trace" @@ -69,8 +69,14 @@ func Initialize() error { return fmt.Errorf("building tracing exporter: %w", err) } tpo = trace.WithBatcher(exp) - case "jaeger": - exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(config.GetTracingEndpoint()))) + case "http": + opts := []otlptracehttp.Option{ + otlptracehttp.WithEndpoint(config.GetTracingEndpoint()), + } + if insecure { + opts = append(opts, otlptracehttp.WithInsecure()) + } + exp, err := otlptracehttp.New(context.Background(), opts...) if err != nil { return fmt.Errorf("building tracing exporter: %w", err) } |