From 2739575524125220c6451cf4c9ca9d345d8e1495 Mon Sep 17 00:00:00 2001 From: Milinda Dias Date: Mon, 4 Aug 2025 21:33:22 +0530 Subject: [PATCH 1/6] fix: propagation --- router-plugin/tracing/interceptor.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/router-plugin/tracing/interceptor.go b/router-plugin/tracing/interceptor.go index da6febe29b..e0857b061a 100644 --- a/router-plugin/tracing/interceptor.go +++ b/router-plugin/tracing/interceptor.go @@ -34,14 +34,10 @@ func CreateTracingInterceptor(tracingOpts TracingOptions) (func(ctx context.Cont return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { if md, ok := metadata.FromIncomingContext(ctx); ok { carrier := propagation.MapCarrier{} - if values := md.Get(traceparentHeader); len(values) > 0 { - carrier[traceparentHeader] = values[0] - } - if values := md.Get(tracestateHeader); len(values) > 0 { - carrier[tracestateHeader] = values[0] - } - if values := md.Get(baggageHeader); len(values) > 0 { - carrier[baggageHeader] = values[0] + for key, values := range md { + if len(values) > 0 { + carrier[key] = values[0] + } } propagator := otel.GetTextMapPropagator() ctx = propagator.Extract(ctx, carrier) From dc4b6f7dcc524561c4144944a5eb70a63169ec6a Mon Sep 17 00:00:00 2001 From: Milinda Dias Date: Mon, 4 Aug 2025 22:00:58 +0530 Subject: [PATCH 2/6] fix: comment --- router-plugin/tracing/interceptor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/router-plugin/tracing/interceptor.go b/router-plugin/tracing/interceptor.go index e0857b061a..f15a745365 100644 --- a/router-plugin/tracing/interceptor.go +++ b/router-plugin/tracing/interceptor.go @@ -33,6 +33,7 @@ func CreateTracingInterceptor(tracingOpts TracingOptions) (func(ctx context.Cont return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { if md, ok := metadata.FromIncomingContext(ctx); ok { + // Extract headers from the incoming context carrier := propagation.MapCarrier{} for key, values := range md { if len(values) > 0 { From 035f3c883cd4a5623206e108f2f11f217ee06a07 Mon Sep 17 00:00:00 2001 From: Milinda Dias Date: Mon, 4 Aug 2025 22:04:36 +0530 Subject: [PATCH 3/6] fix: ci updates --- .github/workflows/router-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/router-ci.yaml b/.github/workflows/router-ci.yaml index 303bd51b0a..95f6728256 100644 --- a/.github/workflows/router-ci.yaml +++ b/.github/workflows/router-ci.yaml @@ -6,6 +6,7 @@ on: - 'composition-go/**/*' - 'demo/**/*' - 'router/**/*' + - 'router-plugin/**/*' - 'router-tests/**/*' - 'connect/**/*' - '.github/workflows/router-ci.yaml' From 7abf547ed914eb18e4570d31ea457b251cfed5df Mon Sep 17 00:00:00 2001 From: Milinda Dias Date: Mon, 4 Aug 2025 22:06:06 +0530 Subject: [PATCH 4/6] fix: spellings --- router/pkg/grpcconnector/grpc_plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/pkg/grpcconnector/grpc_plugin.go b/router/pkg/grpcconnector/grpc_plugin.go index fb580a8ac6..fca4b9ff5a 100644 --- a/router/pkg/grpcconnector/grpc_plugin.go +++ b/router/pkg/grpcconnector/grpc_plugin.go @@ -98,7 +98,7 @@ func (p *GRPCPlugin) fork() error { pluginCmd := newPluginCommand(filePath) // This is the same as SkipHostEnv false - // except that we do that first so that any params are not overriden + // except that we do that first so that any params are not overridden pluginCmd.Env = append(pluginCmd.Env, os.Environ()...) configJson, err := json.Marshal(p.startupConfig) From 2434a38004c56d1b4d3f12fe5c57a1784bb72b1e Mon Sep 17 00:00:00 2001 From: Milinda Dias Date: Mon, 4 Aug 2025 22:08:40 +0530 Subject: [PATCH 5/6] fix: comments updated --- router/pkg/grpcconnector/grpc_plugin.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/router/pkg/grpcconnector/grpc_plugin.go b/router/pkg/grpcconnector/grpc_plugin.go index fca4b9ff5a..64b3b4427c 100644 --- a/router/pkg/grpcconnector/grpc_plugin.go +++ b/router/pkg/grpcconnector/grpc_plugin.go @@ -97,8 +97,9 @@ func (p *GRPCPlugin) fork() error { pluginCmd := newPluginCommand(filePath) - // This is the same as SkipHostEnv false - // except that we do that first so that any params are not overridden + // This is the same as SkipHostEnv false, except + // that we set the base env variables first so that any params + // that may contain the same name are not overridden pluginCmd.Env = append(pluginCmd.Env, os.Environ()...) configJson, err := json.Marshal(p.startupConfig) From 5a82f77eb25a5a9f989a4b6ff206deace4c501b1 Mon Sep 17 00:00:00 2001 From: Milinda Dias Date: Mon, 4 Aug 2025 22:26:02 +0530 Subject: [PATCH 6/6] fix: updates --- router-plugin/tracing/interceptor.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/router-plugin/tracing/interceptor.go b/router-plugin/tracing/interceptor.go index f15a745365..bf7eba0048 100644 --- a/router-plugin/tracing/interceptor.go +++ b/router-plugin/tracing/interceptor.go @@ -12,12 +12,6 @@ import ( "google.golang.org/grpc/metadata" ) -const ( - traceparentHeader = "traceparent" - tracestateHeader = "tracestate" - baggageHeader = "baggage" -) - func CreateTracingInterceptor(tracingOpts TracingOptions) (func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error), error) { if tracingOpts.TracingConfig == nil { return nil, errors.New("nil tracing config not supported")