Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service discovery subscription #2480

Merged
merged 13 commits into from
Nov 5, 2023
Prev Previous commit
Next Next commit
code format
  • Loading branch information
chickenlj committed Nov 3, 2023
commit 074ee5c8d02115738b83cbd520a64d4b2215eec3
4 changes: 2 additions & 2 deletions common/extension/otel_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
)

import (
"dubbo.apache.org/dubbo-go/v3/otel/trace"
"github.com/dubbogo/gost/log/logger"
)

import (
"github.com/dubbogo/gost/log/logger"
"dubbo.apache.org/dubbo-go/v3/otel/trace"
)

var traceExporterMap = make(map[string]func(config *trace.ExporterConfig) (trace.Exporter, error), 4)
Expand Down
5 changes: 4 additions & 1 deletion common/extension/registry_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

package extension

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

import (
"dubbo.apache.org/dubbo-go/v3/cluster/directory"
"dubbo.apache.org/dubbo-go/v3/common"
"dubbo.apache.org/dubbo-go/v3/registry"
"github.com/dubbogo/gost/log/logger"
)

type registryDirectory func(url *common.URL, registry registry.Registry) (directory.Directory, error)
Expand Down
3 changes: 3 additions & 0 deletions config/otel_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ package config

import (
"github.com/creasty/defaults"

"github.com/dubbogo/gost/log/logger"

"github.com/pkg/errors"

"go.opentelemetry.io/otel"
)

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5
github.com/dubbogo/gost v1.14.0
github.com/dubbogo/grpc-go v1.42.10
github.com/dubbogo/tools v1.0.9 // indirect
github.com/dubbogo/triple v1.2.2-rc3
github.com/dustin/go-humanize v1.0.1
github.com/emicklei/go-restful/v3 v3.10.1
Expand All @@ -39,7 +40,7 @@ require (
github.com/influxdata/tdigest v0.0.1
github.com/jinzhu/copier v0.3.5
github.com/knadh/koanf v1.5.0
github.com/magiconair/properties v1.8.1
github.com/magiconair/properties v1.8.5
github.com/mattn/go-colorable v0.1.13
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0
Expand Down
126 changes: 126 additions & 0 deletions go.sum

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions imports/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/metrics/app_info"
_ "dubbo.apache.org/dubbo-go/v3/metrics/prometheus"
_ "dubbo.apache.org/dubbo-go/v3/otel/trace/jaeger"
_ "dubbo.apache.org/dubbo-go/v3/otel/trace/zipkin"
//_ "dubbo.apache.org/dubbo-go/v3/otel/trace/otlp" // FIXME: otlp-grpc use grpc health check which has the namespace conflict with dubbo3 protocol
_ "dubbo.apache.org/dubbo-go/v3/otel/trace/stdout"
_ "dubbo.apache.org/dubbo-go/v3/otel/trace/zipkin"
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3/health"
Expand Down
4 changes: 4 additions & 0 deletions otel/trace/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ import (

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

"go.opentelemetry.io/contrib/propagators/b3"

"go.opentelemetry.io/otel/propagation"

"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"

semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
)

Expand Down
9 changes: 5 additions & 4 deletions otel/trace/jaeger/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import (
)

import (
"dubbo.apache.org/dubbo-go/v3/common/extension"
"dubbo.apache.org/dubbo-go/v3/otel/trace"
"go.opentelemetry.io/otel/exporters/jaeger"

sdktrace "go.opentelemetry.io/otel/sdk/trace"
)

import (
"go.opentelemetry.io/otel/exporters/jaeger"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"dubbo.apache.org/dubbo-go/v3/common/extension"
"dubbo.apache.org/dubbo-go/v3/otel/trace"
)

var (
Expand Down
11 changes: 6 additions & 5 deletions otel/trace/otlp/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ 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/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"
)

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

var (
initHttpOnce sync.Once
httpInstance *Exporter
Expand Down
8 changes: 5 additions & 3 deletions otel/trace/stdout/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ import (
)

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

"go.opentelemetry.io/otel/exporters/stdout/stdouttrace"

sdktrace "go.opentelemetry.io/otel/sdk/trace"
)

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

var (
initOnce sync.Once
instance *Exporter
Expand Down
9 changes: 5 additions & 4 deletions otel/trace/zipkin/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import (
)

import (
"dubbo.apache.org/dubbo-go/v3/common/extension"
"dubbo.apache.org/dubbo-go/v3/otel/trace"
"go.opentelemetry.io/otel/exporters/zipkin"

sdktrace "go.opentelemetry.io/otel/sdk/trace"
)

import (
"go.opentelemetry.io/otel/exporters/zipkin"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"dubbo.apache.org/dubbo-go/v3/common/extension"
"dubbo.apache.org/dubbo-go/v3/otel/trace"
)

var (
Expand Down
8 changes: 6 additions & 2 deletions protocol/dubbo3/health/triple_health_v1/health.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions protocol/dubbo3/health/triple_health_v1/health_triple.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion registry/protocol/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package protocol

import (
"dubbo.apache.org/dubbo-go/v3/registry/directory"
"testing"
"time"
)
Expand All @@ -41,6 +40,7 @@ import (
"dubbo.apache.org/dubbo-go/v3/protocol"
"dubbo.apache.org/dubbo-go/v3/protocol/protocolwrapper"
"dubbo.apache.org/dubbo-go/v3/registry"
"dubbo.apache.org/dubbo-go/v3/registry/directory"
"dubbo.apache.org/dubbo-go/v3/remoting"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
package servicediscovery

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

import (
gxset "github.com/dubbogo/gost/container/set"
"github.com/dubbogo/gost/gof/observer"
"github.com/dubbogo/gost/log/logger"
)

import (
Expand Down