update trace logic
This commit is contained in:
@ -93,6 +93,10 @@ func newCommonTraceProvider(ctx context.Context, params TraceProviderParams) (tp
|
||||
return "bigstats:kuriweb", nil
|
||||
}),
|
||||
),
|
||||
resource.WithAttributes(
|
||||
semconv.ServiceName("bigstats:kuriweb"),
|
||||
semconv.DeploymentEnvironment("production"),
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("making new resource: %w", err)
|
||||
@ -124,14 +128,19 @@ func newCommonTraceProvider(ctx context.Context, params TraceProviderParams) (tp
|
||||
spanExporter, err = otlptracegrpc.New(
|
||||
ctx,
|
||||
otlptracegrpc.WithEndpointURL(params.Endpoint),
|
||||
otlptracegrpc.WithInsecure(),
|
||||
otlptracegrpc.WithHeaders(headers),
|
||||
otlptracegrpc.WithCompressor("gzip"),
|
||||
)
|
||||
case config.TraceClientTypeHTTP:
|
||||
httpClient := otlptracehttp.NewClient(
|
||||
otlptracehttp.WithEndpointURL(params.Endpoint),
|
||||
otlptracehttp.WithHeaders(headers),
|
||||
otlptracehttp.WithCompression(otlptracehttp.GzipCompression),
|
||||
)
|
||||
spanExporter, err = otlptrace.New(
|
||||
ctx, httpClient,
|
||||
)
|
||||
spanExporter, err = otlptrace.New(ctx, httpClient)
|
||||
case config.TraceClientTypeStdout:
|
||||
spanExporter, err = stdouttrace.New(stdouttrace.WithPrettyPrint())
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user