Skip to content

Commit

Permalink
style: format imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ev1lQuark committed Aug 18, 2023
1 parent ec31db3 commit 32edab9
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
6 changes: 6 additions & 0 deletions common/extension/otel_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ package extension

import (
"context"
)

import (
"dubbo.apache.org/dubbo-go/v3/otel/trace"
)

import (
"github.com/dubbogo/gost/log/logger"
)

Expand Down
27 changes: 24 additions & 3 deletions config/otel_config_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package config

import (
"github.com/stretchr/testify/assert"
"testing"
)

import (
"github.com/stretchr/testify/assert"
)

func TestNewOtelConfigBuilder(t *testing.T) {
config := NewOtelConfigBuilder().Build()
assert.NotNil(t, config)
assert.NotNil(t, config.TraceConfig)

err := config.Init()
ac := NewApplicationConfigBuilder().Build()
err := config.Init(ac)
assert.NoError(t, err)

tpc := config.TraceConfig.toTraceProviderConfig()
tpc := config.TraceConfig.toTraceProviderConfig(ac)
assert.NotNil(t, tpc)
}
2 changes: 1 addition & 1 deletion filter/otel/trace/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions otel/trace/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down
8 changes: 7 additions & 1 deletion otel/trace/jaeger/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 7 additions & 1 deletion otel/trace/otlp/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 7 additions & 1 deletion otel/trace/zipkin/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 32edab9

Please sign in to comment.