mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 23:42:24 -05:00
[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
This commit is contained in:
parent
916c6d07ba
commit
14ef098099
199 changed files with 12972 additions and 18581 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue