mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
New tracing system (#5388)
* update tracing config definitions * new tracing system * performance improvements * only configure tracing in envoy if it is enabled in pomerium * [tracing] refactor to use custom extension for trace id editing (#5420) refactor to use custom extension for trace id editing * set default tracing sample rate to 1.0 * fix proxy service http middleware * improve some existing auth related traces * test fixes * bump envoyproxy/go-control-plane * code cleanup * test fixes * Fix missing spans for well-known endpoints * import extension apis from pomerium/envoy-custom
This commit is contained in:
parent
832742648d
commit
396c35b6b4
121 changed files with 6096 additions and 1946 deletions
|
@ -15,18 +15,23 @@ import (
|
|||
"github.com/pomerium/pomerium/internal/log"
|
||||
"github.com/pomerium/pomerium/pkg/grpc"
|
||||
pb "github.com/pomerium/pomerium/pkg/grpc/registry"
|
||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
||||
oteltrace "go.opentelemetry.io/otel/trace"
|
||||
googlegrpc "google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Reporter periodically submits a list of services available on this instance to the service registry
|
||||
type Reporter struct {
|
||||
cancel func()
|
||||
outboundGRPCConnection *grpc.CachedOutboundGRPClientConn
|
||||
tracerProvider oteltrace.TracerProvider
|
||||
}
|
||||
|
||||
// NewReporter creates a new Reporter.
|
||||
func NewReporter() *Reporter {
|
||||
func NewReporter(tracerProvider oteltrace.TracerProvider) *Reporter {
|
||||
return &Reporter{
|
||||
outboundGRPCConnection: new(grpc.CachedOutboundGRPClientConn),
|
||||
tracerProvider: tracerProvider,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +57,7 @@ func (r *Reporter) OnConfigChange(ctx context.Context, cfg *config.Config) {
|
|||
InstallationID: cfg.Options.InstallationID,
|
||||
ServiceName: cfg.Options.Services,
|
||||
SignedJWTKey: sharedKey,
|
||||
})
|
||||
}, googlegrpc.WithStatsHandler(otelgrpc.NewClientHandler(otelgrpc.WithTracerProvider(r.tracerProvider))))
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Error().Err(err).Msg("connecting to registry")
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue