Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Add HTTP Tracecontext propagation to delivery client provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-mi committed May 14, 2020
1 parent 585f6d4 commit cafe654
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/broker/fanout/wire_gen.go

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

2 changes: 1 addition & 1 deletion cmd/broker/retry/wire_gen.go

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

8 changes: 7 additions & 1 deletion pkg/broker/handler/pool/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
cehttp "github.com/cloudevents/sdk-go/v2/protocol/http"
cepubsub "github.com/cloudevents/sdk-go/v2/protocol/pubsub"
"github.com/google/wire"
"go.opencensus.io/plugin/ochttp"
"go.opencensus.io/plugin/ochttp/propagation/tracecontext"
)

var (
Expand All @@ -33,6 +35,10 @@ var (
ceclient.WithTracePropagation(),
}

DefaultHTTPOpts = []cehttp.Option{
cehttp.WithRoundTripper(&ochttp.Transport{Propagation: &tracecontext.HTTPFormat{}}),
}

// ProviderSet provides the fanout and retry sync pools using the default client options. In
// order to inject either pool, ProjectID, []Option, and config.ReadOnlyTargets must be
// externally provided.
Expand All @@ -43,7 +49,7 @@ var (
NewDeliverClient,
NewPubsubClient,
NewRetryClient,
wire.Value([]cehttp.Option(nil)),
wire.Value(DefaultHTTPOpts),
wire.Value(DefaultCEClientOpts),
)
)
Expand Down

0 comments on commit cafe654

Please sign in to comment.