From 19cff4a7ea57ed11e3cee06dd85e313364cc388f Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Thu, 26 Dec 2024 11:13:56 +0530 Subject: [PATCH 1/7] feat[jaeger-receiver]: log the endpoint of the server listening Signed-off-by: Saumyacodes-40 --- receiver/jaegerreceiver/trace_receiver.go | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/receiver/jaegerreceiver/trace_receiver.go b/receiver/jaegerreceiver/trace_receiver.go index 3e3b44c83e72..bc3236ef86f1 100644 --- a/receiver/jaegerreceiver/trace_receiver.go +++ b/receiver/jaegerreceiver/trace_receiver.go @@ -35,6 +35,7 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" "go.uber.org/multierr" + "go.uber.org/zap" "google.golang.org/grpc" jaegertranslator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger" @@ -247,6 +248,12 @@ func (jr *jReceiver) startAgent(host component.Host) error { return err } jr.agentProcessors = append(jr.agentProcessors, processor) + + jr.settings.Logger.Info("Starting Binary Thrift server", + zap.String("kind", "receiver"), + zap.String("name", "jaegerreceiver"), + zap.String("endpoint", jr.config.AgentBinaryThrift.Endpoint), + ) } if jr.config.AgentCompactThrift.Endpoint != "" { @@ -267,6 +274,12 @@ func (jr *jReceiver) startAgent(host component.Host) error { return err } jr.agentProcessors = append(jr.agentProcessors, processor) + + jr.settings.Logger.Info("Starting Compact Thrift server", + zap.String("kind", "receiver"), + zap.String("name", "jaegerreceiver"), + zap.String("endpoint", jr.config.AgentCompactThrift.Endpoint), + ) } jr.goroutines.Add(len(jr.agentProcessors)) @@ -280,6 +293,12 @@ func (jr *jReceiver) startAgent(host component.Host) error { if jr.config.AgentHTTPEndpoint != "" { jr.agentServer = httpserver.NewHTTPServer(jr.config.AgentHTTPEndpoint, ¬ImplementedConfigManager{}, metrics.NullFactory, jr.settings.Logger) + jr.settings.Logger.Info("Starting HTTP server", + zap.String("kind", "receiver"), + zap.String("name", "jaegerreceiver"), + zap.String("endpoint", jr.config.AgentHTTPEndpoint), + ) + jr.goroutines.Add(1) go func() { defer jr.goroutines.Done() @@ -388,6 +407,12 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er return err } + jr.settings.Logger.Info("Starting HTTP collector server", + zap.String("kind", "receiver"), + zap.String("name", "jaegerreceiver"), + zap.String("endpoint", jr.config.HTTPServerConfig.Endpoint), + ) + jr.goroutines.Add(1) go func() { defer jr.goroutines.Done() @@ -411,6 +436,12 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er api_v2.RegisterCollectorServiceServer(jr.grpc, jr) + jr.settings.Logger.Info("Starting gRPC collector server", + zap.String("kind", "receiver"), + zap.String("name", "jaegerreceiver"), + zap.String("endpoint", jr.config.GRPCServerConfig.NetAddr.Endpoint), + ) + jr.goroutines.Add(1) go func() { defer jr.goroutines.Done() From 0090b577286987e670e6794f8dcb74416ca11b3e Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Thu, 26 Dec 2024 13:09:47 +0530 Subject: [PATCH 2/7] fix: use meaningful description during logging info Signed-off-by: Saumyacodes-40 --- receiver/jaegerreceiver/trace_receiver.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/receiver/jaegerreceiver/trace_receiver.go b/receiver/jaegerreceiver/trace_receiver.go index bc3236ef86f1..eea748996abc 100644 --- a/receiver/jaegerreceiver/trace_receiver.go +++ b/receiver/jaegerreceiver/trace_receiver.go @@ -249,7 +249,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { } jr.agentProcessors = append(jr.agentProcessors, processor) - jr.settings.Logger.Info("Starting Binary Thrift server", + jr.settings.Logger.Info("Starting UDP server for Binary Thrift", zap.String("kind", "receiver"), zap.String("name", "jaegerreceiver"), zap.String("endpoint", jr.config.AgentBinaryThrift.Endpoint), @@ -275,7 +275,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { } jr.agentProcessors = append(jr.agentProcessors, processor) - jr.settings.Logger.Info("Starting Compact Thrift server", + jr.settings.Logger.Info("Starting UDP server for Compact Thrift", zap.String("kind", "receiver"), zap.String("name", "jaegerreceiver"), zap.String("endpoint", jr.config.AgentCompactThrift.Endpoint), @@ -293,7 +293,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { if jr.config.AgentHTTPEndpoint != "" { jr.agentServer = httpserver.NewHTTPServer(jr.config.AgentHTTPEndpoint, ¬ImplementedConfigManager{}, metrics.NullFactory, jr.settings.Logger) - jr.settings.Logger.Info("Starting HTTP server", + jr.settings.Logger.Info("Starting HTTP server for Jaeger Agent", zap.String("kind", "receiver"), zap.String("name", "jaegerreceiver"), zap.String("endpoint", jr.config.AgentHTTPEndpoint), @@ -407,7 +407,7 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er return err } - jr.settings.Logger.Info("Starting HTTP collector server", + jr.settings.Logger.Info("Starting HTTP server for Jaeger Collector", zap.String("kind", "receiver"), zap.String("name", "jaegerreceiver"), zap.String("endpoint", jr.config.HTTPServerConfig.Endpoint), @@ -436,7 +436,7 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er api_v2.RegisterCollectorServiceServer(jr.grpc, jr) - jr.settings.Logger.Info("Starting gRPC collector server", + jr.settings.Logger.Info("Starting gRPC server for Jaeger Collector", zap.String("kind", "receiver"), zap.String("name", "jaegerreceiver"), zap.String("endpoint", jr.config.GRPCServerConfig.NetAddr.Endpoint), From adafb33efa916c229f606dddea3d588f3cab564b Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Fri, 27 Dec 2024 21:00:30 +0530 Subject: [PATCH 3/7] remove kind and name fields (handled by default) Signed-off-by: Saumyacodes-40 --- receiver/jaegerreceiver/trace_receiver.go | 30 ++++------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/receiver/jaegerreceiver/trace_receiver.go b/receiver/jaegerreceiver/trace_receiver.go index eea748996abc..d5c85351023e 100644 --- a/receiver/jaegerreceiver/trace_receiver.go +++ b/receiver/jaegerreceiver/trace_receiver.go @@ -249,11 +249,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { } jr.agentProcessors = append(jr.agentProcessors, processor) - jr.settings.Logger.Info("Starting UDP server for Binary Thrift", - zap.String("kind", "receiver"), - zap.String("name", "jaegerreceiver"), - zap.String("endpoint", jr.config.AgentBinaryThrift.Endpoint), - ) + jr.settings.Logger.Info("Starting UDP server for Binary Thrift", zap.String("endpoint", jr.config.AgentBinaryThrift.Endpoint)) } if jr.config.AgentCompactThrift.Endpoint != "" { @@ -275,11 +271,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { } jr.agentProcessors = append(jr.agentProcessors, processor) - jr.settings.Logger.Info("Starting UDP server for Compact Thrift", - zap.String("kind", "receiver"), - zap.String("name", "jaegerreceiver"), - zap.String("endpoint", jr.config.AgentCompactThrift.Endpoint), - ) + jr.settings.Logger.Info("Starting UDP server for Compact Thrift", zap.String("endpoint", jr.config.AgentCompactThrift.Endpoint)) } jr.goroutines.Add(len(jr.agentProcessors)) @@ -293,11 +285,7 @@ func (jr *jReceiver) startAgent(host component.Host) error { if jr.config.AgentHTTPEndpoint != "" { jr.agentServer = httpserver.NewHTTPServer(jr.config.AgentHTTPEndpoint, ¬ImplementedConfigManager{}, metrics.NullFactory, jr.settings.Logger) - jr.settings.Logger.Info("Starting HTTP server for Jaeger Agent", - zap.String("kind", "receiver"), - zap.String("name", "jaegerreceiver"), - zap.String("endpoint", jr.config.AgentHTTPEndpoint), - ) + jr.settings.Logger.Info("Starting HTTP server for Jaeger Agent", zap.String("endpoint", jr.config.AgentHTTPEndpoint)) jr.goroutines.Add(1) go func() { @@ -407,11 +395,7 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er return err } - jr.settings.Logger.Info("Starting HTTP server for Jaeger Collector", - zap.String("kind", "receiver"), - zap.String("name", "jaegerreceiver"), - zap.String("endpoint", jr.config.HTTPServerConfig.Endpoint), - ) + jr.settings.Logger.Info("Starting HTTP server for Jaeger Collector", zap.String("endpoint", jr.config.HTTPServerConfig.Endpoint)) jr.goroutines.Add(1) go func() { @@ -436,11 +420,7 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er api_v2.RegisterCollectorServiceServer(jr.grpc, jr) - jr.settings.Logger.Info("Starting gRPC server for Jaeger Collector", - zap.String("kind", "receiver"), - zap.String("name", "jaegerreceiver"), - zap.String("endpoint", jr.config.GRPCServerConfig.NetAddr.Endpoint), - ) + jr.settings.Logger.Info("Starting gRPC server for Jaeger Collector", zap.String("endpoint", jr.config.GRPCServerConfig.NetAddr.Endpoint)) jr.goroutines.Add(1) go func() { From c5cd657d3775d71e2f6c79422123d0e94615377a Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Fri, 27 Dec 2024 21:44:52 +0530 Subject: [PATCH 4/7] addressed reviewed changes Signed-off-by: Saumyacodes-40 --- receiver/jaegerreceiver/trace_receiver.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/receiver/jaegerreceiver/trace_receiver.go b/receiver/jaegerreceiver/trace_receiver.go index d5c85351023e..369864b45661 100644 --- a/receiver/jaegerreceiver/trace_receiver.go +++ b/receiver/jaegerreceiver/trace_receiver.go @@ -285,8 +285,6 @@ func (jr *jReceiver) startAgent(host component.Host) error { if jr.config.AgentHTTPEndpoint != "" { jr.agentServer = httpserver.NewHTTPServer(jr.config.AgentHTTPEndpoint, ¬ImplementedConfigManager{}, metrics.NullFactory, jr.settings.Logger) - jr.settings.Logger.Info("Starting HTTP server for Jaeger Agent", zap.String("endpoint", jr.config.AgentHTTPEndpoint)) - jr.goroutines.Add(1) go func() { defer jr.goroutines.Done() @@ -395,7 +393,7 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er return err } - jr.settings.Logger.Info("Starting HTTP server for Jaeger Collector", zap.String("endpoint", jr.config.HTTPServerConfig.Endpoint)) + jr.settings.Logger.Info("Starting HTTP server for Jaeger Thrift", zap.String("endpoint", jr.config.HTTPServerConfig.Endpoint)) jr.goroutines.Add(1) go func() { @@ -420,7 +418,7 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er api_v2.RegisterCollectorServiceServer(jr.grpc, jr) - jr.settings.Logger.Info("Starting gRPC server for Jaeger Collector", zap.String("endpoint", jr.config.GRPCServerConfig.NetAddr.Endpoint)) + jr.settings.Logger.Info("Starting gRPC server for Jaeger Protobuf", zap.String("endpoint", jr.config.GRPCServerConfig.NetAddr.Endpoint)) jr.goroutines.Add(1) go func() { From 9b8e2ae34c2d92aea0cc5b7c962637d84f5d5e05 Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Fri, 27 Dec 2024 22:05:20 +0530 Subject: [PATCH 5/7] add chlog Signed-off-by: Saumyacodes-40 --- .chloggen/log-jaegerreceiver-endpoints.yaml | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .chloggen/log-jaegerreceiver-endpoints.yaml diff --git a/.chloggen/log-jaegerreceiver-endpoints.yaml b/.chloggen/log-jaegerreceiver-endpoints.yaml new file mode 100644 index 000000000000..effd37995386 --- /dev/null +++ b/.chloggen/log-jaegerreceiver-endpoints.yaml @@ -0,0 +1,28 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: receiver/jaegerreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Log the endpoints of different server at which jaegerreceiver is listening to + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [36961] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + This change logs the endpoints of different server at which jaegerreceiver is listening to. It simplifies debugging by ensuring log messages match configuration settings. + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] From 4db9280b74c813858ddd5f448e807744c2bfeb47 Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Fri, 27 Dec 2024 22:46:43 +0530 Subject: [PATCH 6/7] update chlog Signed-off-by: Saumyacodes-40 --- .chloggen/log-jaegerreceiver-endpoints.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.chloggen/log-jaegerreceiver-endpoints.yaml b/.chloggen/log-jaegerreceiver-endpoints.yaml index effd37995386..c2d735a0fc19 100644 --- a/.chloggen/log-jaegerreceiver-endpoints.yaml +++ b/.chloggen/log-jaegerreceiver-endpoints.yaml @@ -4,10 +4,10 @@ change_type: enhancement # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) -component: receiver/jaegerreceiver +component: jaegerreceiver # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Log the endpoints of different server at which jaegerreceiver is listening to +note: Log the endpoints of different servers started by jaegerreceiver # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. issues: [36961] @@ -16,7 +16,7 @@ issues: [36961] # These lines will be padded with 2 spaces and then inserted directly into the document. # Use pipe (|) for multiline entries. subtext: | - This change logs the endpoints of different server at which jaegerreceiver is listening to. It simplifies debugging by ensuring log messages match configuration settings. + This change logs the endpoints of different servers started by jaegerreceiver. It simplifies debugging by ensuring log messages match configuration settings. # If your change doesn't affect end users or the exported elements of any package, # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. From f3c94d2c32fc6df0da86cc9c29eb9706f9e9d77f Mon Sep 17 00:00:00 2001 From: Saumyacodes-40 Date: Fri, 27 Dec 2024 23:43:08 +0530 Subject: [PATCH 7/7] tidy (re: deps change) Signed-off-by: Saumyacodes-40 --- receiver/jaegerreceiver/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/jaegerreceiver/go.mod b/receiver/jaegerreceiver/go.mod index ea1daa0480e7..2f2266cdf5d5 100644 --- a/receiver/jaegerreceiver/go.mod +++ b/receiver/jaegerreceiver/go.mod @@ -27,6 +27,7 @@ require ( go.opentelemetry.io/collector/semconv v0.116.1-0.20241220212031-7c2639723f67 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 + go.uber.org/zap v1.27.0 google.golang.org/grpc v1.69.0 ) @@ -74,7 +75,6 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect