Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the missing async error channel into telemetry.Settings #12111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

omzmarlon
Copy link

Description

Pass the missing async error channel into telemetry.Settings

Link to tracking issue

Fixes #11417

Testing

With the same setup as in #11417, building new otelcol with the changes in this PR, and running 2 instances with the same config using the same metric port, we would see proper crash error messages:

# config used:
receivers:
  nop:
exporters:
  nop:
service:
  pipelines:
    logs:
      receivers:
        - nop
      exporters:
        - nop
  telemetry:
    metrics:
      readers:
      - pull: 
          exporter:
            prometheus: 
              host: localhost
              port: 8889
# first instance log: 
./otelcol-custom --config otel-config.yaml
2025-01-16T17:36:34.638-0800    info    [email protected]/service.go:165 Setting up own telemetry...
2025-01-16T17:36:34.638-0800    info    telemetry/metrics.go:70 Serving metrics {"address": "localhost:8889", "metrics level": "Normal"}
2025-01-16T17:36:34.639-0800    info    [email protected]/service.go:231 Starting otelcol-custom...      {"Version": "", "NumCPU": 16}
2025-01-16T17:36:34.639-0800    info    extensions/extensions.go:39     Starting extensions...
2025-01-16T17:36:34.639-0800    info    [email protected]/service.go:254 Everything is ready. Begin running and processing data.
# second instance's log (using same config)
./otelcol-custom --config otel-config.yaml
2025-01-16T17:36:37.270-0800    info    [email protected]/service.go:165 Setting up own telemetry...
2025-01-16T17:36:37.270-0800    info    telemetry/metrics.go:70 Serving metrics {"address": "localhost:8889", "metrics level": "Normal"}
2025-01-16T17:36:37.271-0800    info    [email protected]/service.go:231 Starting otelcol-custom...      {"Version": "", "NumCPU": 16}
2025-01-16T17:36:37.271-0800    info    extensions/extensions.go:39     Starting extensions...
2025-01-16T17:36:37.271-0800    info    [email protected]/service.go:254 Everything is ready. Begin running and processing data.
2025-01-16T17:36:37.273-0800    error   [email protected]/collector.go:325       Asynchronous error received, terminating process    {"error": "listen tcp 127.0.0.1:8889: bind: address already in use"}
go.opentelemetry.io/collector/otelcol.(*Collector).Run
        go.opentelemetry.io/collector/[email protected]/collector.go:325
go.opentelemetry.io/collector/otelcol.NewCommand.func1
        go.opentelemetry.io/collector/[email protected]/command.go:36
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:985
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1117
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:1041
main.runInteractive
        go.opentelemetry.io/collector/cmd/builder/main.go:49
main.run
        go.opentelemetry.io/collector/cmd/builder/main_others.go:10
main.main
        go.opentelemetry.io/collector/cmd/builder/main.go:42
runtime.main
        runtime/proc.go:272
2025-01-16T17:36:37.273-0800    info    [email protected]/service.go:296 Starting shutdown...
2025-01-16T17:36:37.274-0800    info    extensions/extensions.go:66     Stopping extensions...
2025-01-16T17:36:37.274-0800    info    [email protected]/service.go:310 Shutdown complete.

@omzmarlon omzmarlon requested a review from a team as a code owner January 17, 2025 01:40
@omzmarlon omzmarlon requested a review from djaglowski January 17, 2025 01:40
Copy link

linux-foundation-easycla bot commented Jan 17, 2025

CLA Not Signed

@bogdandrutu
Copy link
Member

Please sign the CLA

@omzmarlon omzmarlon force-pushed the telemetry-async-err-ch branch from 7e837f2 to 393e350 Compare January 17, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service Telemetry Prometheus metrics server does not properly report error
2 participants