Skip to content

Commit

Permalink
[receiver/jaegerreceiver] Add logs when the respective server starts …
Browse files Browse the repository at this point in the history
…in jaegerreceiver (#36961)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
- This PR adds the logging related to the server starting under the
[jaegerreceiver](/~https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/jaegerreceiver)
- Added logs when: GRPC, Thrift Http, Thrift Binary and Thrift compact
server starts

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes jaegertracing/jaeger#6412


#### How was change tested?

Running collector with `jaegerreceiver` enabled with its all transports


#### Output

```
@Saumya40-codes ➜ /workspaces/opentelemetry-collector-contrib (log-endpoints) $ ./bin/otelcontribcol_linux_amd64 --config config.yaml
2024-12-27T15:37:23.428Z        info    service@v0.116.1-0.20241220212031-7c2639723f67/service.go:164   Setting up own telemetry...
2024-12-27T15:37:23.428Z        info    telemetry/metrics.go:70 Serving metrics {"address": "localhost:8888", "metrics level": "Normal"}
2024-12-27T15:37:23.428Z        info    builders/builders.go:26 Development component. May change in the future.        {"kind": "exporter", "data_type": "traces", "name": "debug"}
2024-12-27T15:37:23.436Z        info    service@v0.116.1-0.20241220212031-7c2639723f67/service.go:230   Starting otelcontribcol...      {"Version": "0.116.0-dev", "NumCPU": 2}
2024-12-27T15:37:23.436Z        info    extensions/extensions.go:39     Starting extensions...
2024-12-27T15:37:23.436Z        info    jaegerreceiver@v0.116.0/trace_receiver.go:252   Starting UDP server for Binary Thrift   {"kind": "receiver", "name": "jaeger", "data_type": "traces", "endpoint": "0.0.0.0:6831"}
2024-12-27T15:37:23.436Z        info    jaegerreceiver@v0.116.0/trace_receiver.go:274   Starting UDP server for Compact Thrift  {"kind": "receiver", "name": "jaeger", "data_type": "traces", "endpoint": "0.0.0.0:6832"}
2024-12-27T15:37:23.436Z        info    jaegerreceiver@v0.116.0/trace_receiver.go:398   Starting HTTP server for Jaeger Collector       {"kind": "receiver", "name": "jaeger", "data_type": "traces", "endpoint": "0.0.0.0:14268"}
2024-12-27T15:37:23.436Z        info    jaegerreceiver@v0.116.0/trace_receiver.go:423   Starting gRPC server for Jaeger Collector       {"kind": "receiver", "name": "jaeger", "data_type": "traces", "endpoint": "0.0.0.0:14250"}
2024-12-27T15:37:23.436Z        info    service@v0.116.1-0.20241220212031-7c2639723f67/service.go:253   Everything is ready. Begin running and processing data.
```


#### config file used

```
receivers:
  jaeger:
    protocols:
      grpc:
        endpoint: "0.0.0.0:14250"
      thrift_http:
        endpoint: "0.0.0.0:14268"
      thrift_binary:
        endpoint: "0.0.0.0:6831"
      thrift_compact:
        endpoint: "0.0.0.0:6832"
        
exporters:
  debug: {}

service:
  pipelines:
    traces:
      receivers: [jaeger]
      exporters: [debug]
```

cc @fatsheep9146

---------

Signed-off-by: Saumyacodes-40 <saumyabshah90@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
  • Loading branch information
Saumya40-codes and yurishkuro authored Jan 22, 2025
1 parent 96e7cd8 commit 6156ecb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .chloggen/log-jaegerreceiver-endpoints.yaml
Original file line number Diff line number Diff line change
@@ -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: 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 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]

# (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 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.
# 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]
2 changes: 1 addition & 1 deletion receiver/jaegerreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ require (
go.opentelemetry.io/collector/semconv v0.118.1-0.20250121185328-fbefb22cc2b3
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.4
)

Expand Down Expand Up @@ -75,7 +76,6 @@ require (
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
Expand Down
9 changes: 9 additions & 0 deletions receiver/jaegerreceiver/trace_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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"
Expand Down Expand Up @@ -214,6 +215,8 @@ func (jr *jReceiver) startAgent() error {
return err
}
jr.agentProcessors = append(jr.agentProcessors, processor)

jr.settings.Logger.Info("Starting UDP server for Binary Thrift", zap.String("endpoint", jr.config.ThriftBinaryUDP.Endpoint))
}

if jr.config.ThriftCompactUDP != nil {
Expand All @@ -234,6 +237,8 @@ func (jr *jReceiver) startAgent() error {
return err
}
jr.agentProcessors = append(jr.agentProcessors, processor)

jr.settings.Logger.Info("Starting UDP server for Compact Thrift", zap.String("endpoint", jr.config.ThriftCompactUDP.Endpoint))
}

jr.goroutines.Add(len(jr.agentProcessors))
Expand Down Expand Up @@ -339,6 +344,8 @@ func (jr *jReceiver) startCollector(ctx context.Context, host component.Host) er
return err
}

jr.settings.Logger.Info("Starting HTTP server for Jaeger Thrift", zap.String("endpoint", jr.config.ThriftHTTP.Endpoint))

jr.goroutines.Add(1)
go func() {
defer jr.goroutines.Done()
Expand All @@ -362,6 +369,8 @@ 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 Protobuf", zap.String("endpoint", jr.config.GRPC.NetAddr.Endpoint))

jr.goroutines.Add(1)
go func() {
defer jr.goroutines.Done()
Expand Down

0 comments on commit 6156ecb

Please sign in to comment.