From e3b50026328fc67b571f67e405c7a796524500b4 Mon Sep 17 00:00:00 2001 From: Wang Guan Date: Fri, 18 Aug 2023 19:38:58 +0800 Subject: [PATCH] style: format imports --- common/extension/otel_trace.go | 6 ++++++ filter/otel/trace/doc.go | 2 +- otel/trace/exporter.go | 4 ++++ otel/trace/jaeger/exporter.go | 8 +++++++- otel/trace/otlp/exporter.go | 8 +++++++- otel/trace/zipkin/exporter.go | 8 +++++++- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/common/extension/otel_trace.go b/common/extension/otel_trace.go index 4def9f149b..f8023d7a09 100644 --- a/common/extension/otel_trace.go +++ b/common/extension/otel_trace.go @@ -19,7 +19,13 @@ package extension import ( "context" +) + +import ( "dubbo.apache.org/dubbo-go/v3/otel/trace" +) + +import ( "github.com/dubbogo/gost/log/logger" ) diff --git a/filter/otel/trace/doc.go b/filter/otel/trace/doc.go index 5d7dfb3c70..c3c1ce3579 100644 --- a/filter/otel/trace/doc.go +++ b/filter/otel/trace/doc.go @@ -15,6 +15,6 @@ * limitations under the License. */ -// Package jaeger instruments dubbogo with open-telemetry +// Package trace instruments dubbogo with open-telemetry // (https://github.com/open-telemetry/opentelemetry-go). package trace diff --git a/otel/trace/exporter.go b/otel/trace/exporter.go index 5d4a303b4e..454b02a975 100644 --- a/otel/trace/exporter.go +++ b/otel/trace/exporter.go @@ -20,6 +20,9 @@ package trace import ( "errors" "fmt" +) + +import ( "github.com/dubbogo/gost/log/logger" "go.opentelemetry.io/contrib/propagators/b3" "go.opentelemetry.io/otel/propagation" @@ -57,6 +60,7 @@ func (e *DefaultExporter) GetPropagator() propagation.TextMapPropagator { return e.Propagator } +// NewExporter is an absolute function with @customFunc to create a spec exporter func NewExporter(config *ExporterConfig, customFunc func() (sdktrace.SpanExporter, error)) (tracerProvider *sdktrace.TracerProvider, propagator propagation.TextMapPropagator, err error) { if config == nil { err = errors.New("otel exporter config is nil") diff --git a/otel/trace/jaeger/exporter.go b/otel/trace/jaeger/exporter.go index efcad8fb92..65a269022c 100644 --- a/otel/trace/jaeger/exporter.go +++ b/otel/trace/jaeger/exporter.go @@ -17,12 +17,18 @@ package jaeger +import ( + "sync" +) + import ( "dubbo.apache.org/dubbo-go/v3/common/extension" "dubbo.apache.org/dubbo-go/v3/otel/trace" +) + +import ( "go.opentelemetry.io/otel/exporters/jaeger" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "sync" ) var ( diff --git a/otel/trace/otlp/exporter.go b/otel/trace/otlp/exporter.go index 8c02208794..69e2adeb1f 100644 --- a/otel/trace/otlp/exporter.go +++ b/otel/trace/otlp/exporter.go @@ -19,13 +19,19 @@ package otlp import ( "context" + "sync" +) + +import ( "dubbo.apache.org/dubbo-go/v3/common/extension" "dubbo.apache.org/dubbo-go/v3/otel/trace" +) + +import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "sync" ) var ( diff --git a/otel/trace/zipkin/exporter.go b/otel/trace/zipkin/exporter.go index 383717623a..4068872ce3 100644 --- a/otel/trace/zipkin/exporter.go +++ b/otel/trace/zipkin/exporter.go @@ -17,12 +17,18 @@ package zipkin +import ( + "sync" +) + import ( "dubbo.apache.org/dubbo-go/v3/common/extension" "dubbo.apache.org/dubbo-go/v3/otel/trace" +) + +import ( "go.opentelemetry.io/otel/exporters/zipkin" sdktrace "go.opentelemetry.io/otel/sdk/trace" - "sync" ) var (