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

Otel exporter not working with Kafka #34134

Open
harshalschaudhari opened this issue Jul 17, 2024 · 6 comments
Open

Otel exporter not working with Kafka #34134

harshalschaudhari opened this issue Jul 17, 2024 · 6 comments
Labels
bug Something isn't working exporter/kafka

Comments

@harshalschaudhari
Copy link

Component(s)

exporter/kafka

What happened?

Description

The application generates traces that can be viewed in Jaeger. I attempted to configure the Otel collector to send these traces to Kafka using various combinations within a Docker Compose setup, but encountered the following error:

Steps to Reproduce

Expected Result

Kafka shows the traces in respective topic.

Actual Result

2024-07-17 16:56:13 2024-07-17T11:26:13.794Z info service@v0.104.0/service.go:115 Setting up own telemetry...
2024-07-17 16:56:13 2024-07-17T11:26:13.799Z info service@v0.104.0/telemetry.go:96 Serving metrics {"address": ":8888", "level": "Normal"}
2024-07-17 16:56:13 2024-07-17T11:26:13.816Z info service@v0.104.0/service.go:193 Starting otelcol... {"Version": "0.104.0", "NumCPU": 2}
2024-07-17 16:56:13 2024-07-17T11:26:13.820Z info extensions/extensions.go:34 Starting extensions...
2024-07-17 16:56:14 2024-07-17T11:26:14.592Z info service@v0.104.0/service.go:256 Starting shutdown...
2024-07-17 16:56:14 2024-07-17T11:26:14.592Z info extensions/extensions.go:59 Stopping extensions...
2024-07-17 16:56:14 2024-07-17T11:26:14.592Z info service@v0.104.0/service.go:270 Shutdown complete.
2024-07-17 16:56:14 Error: cannot start pipelines: kafka: client has run out of available brokers to talk to: dial tcp [::1]:9092: connect: connection refused
2024-07-17 16:56:14 2024/07/17 11:26:14 collector server run finished with error: cannot start pipelines: kafka: client has run out of available brokers to talk to: dial tcp [::1]:9092: connect: connection refused

Collector version

0.104.0

Environment information

Environment

Docker-Compose

otel-collector:     image: otel/opentelemetry-collector:0.104.0 #otel/opentelemetry-collector:latest     container_name: otel-collector     volumes:       - ./otel-config.yaml:/etc/otel/config.yaml     ports:       - "127.0.0.1:4317:4317"       - "127.0.0.1:55679:55679"     command: ["--config", "/etc/otel/config.yaml"]     networks:       - otel-network     depends_on:       - kafka

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  batch:

exporters:
  logging:
    loglevel: debug
  kafka:
    brokers: ["localhost:9092"]
    topic: "traces"
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, kafka]

Log output

No response

Additional context

No response

@harshalschaudhari harshalschaudhari added bug Something isn't working needs triage New item requiring triage labels Jul 17, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@francois07
Copy link

I believe this is related to #24029 TL;DR if Kafka is not available on startup the collector crashes

@harshalschaudhari
Copy link
Author

harshalschaudhari commented Jul 18, 2024

Note: I have tried out kafka using docker with port 29092

Pod Logs as below

2024-07-18 16:25:51 Error: cannot start pipelines: kafka: client has run out of available brokers to talk to: dial tcp 172.20.0.9:29092: connect: connection refused
2024-07-18 16:25:51 2024/07/18 10:55:51 collector server run finished with error: cannot start pipelines: kafka: client has run out of available brokers to talk to: dial tcp 172.20.0.9:29092: connect: connection refused

Additional information
I am able to connect Kafka using Offset Explorer 3.0.
image

OTEL Configuration

exporters:
  kafka:
    brokers:
      - kafka:9092

@hchaudhari-conga
Copy link

any update?

@sydneydf
Copy link

Hey, Came to make an issue but my issue is near exact same.

Currently using alloy which leverages this component as a wrapper. Exact same error.

Fails with this component when reaching confluent cloud 9092 over a azure privatelinkservice connection (we have kafka connectors in the same subnet operating with no problems.)

Would be really nice to get this working as my organisation has some very unique DMZ requirements for a new project that this would solve perfectly.

@atoulme
Copy link
Contributor

atoulme commented Oct 2, 2024

brokers: ["localhost:9092"] will not work on a docker env. localhost means the lo network interface inside the container. Please provide the right host for the kafka endpoint.

@atoulme atoulme removed the needs triage New item requiring triage label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/kafka
Projects
None yet
Development

No branches or pull requests

5 participants