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

[exporter/syslog-exporter] Unable to send traces to Syslog sink via UDP #31130

Closed
kyleprice opened this issue Feb 8, 2024 · 7 comments
Closed
Assignees
Labels
bug Something isn't working exporter/syslog

Comments

@kyleprice
Copy link

Component(s)

exporter/syslog

What happened?

Description

When receiving syslog messages and then transmitting via UDP I have the following config:

syslog:
network: udp
port: 1500
endpoint: 10.0.0.2 (local network connection that accepts udp only)

retry_on_failure:
enabled: true

sending_queue:
enabled: true

receivers:
syslog:
tcp:
listen_address: "0.0.0.0:54500"
protocol: rfc3164
location: UTC

service:
pipelines:
logs:
exporters:
- syslog
receivers:
- syslog

Actual Result

This produces tcp connections on the exporter instead of sending over udp. The sink I am using accepts a udp connection, as a result it fails to ship logs to it.

Exporting failed. Dropping data. Try enabling retry_on_failure config option to retry on retryable errors. {"kind": "exporter", data_type": "logs", "name": "syslog", "error": dial tcp 10.0.0.2:1500: connect: connection refused", "dropped_items": 4}

Expected Result

I would expect this to send logs over udp. I looked through the code and saw this line which looks to set the network to tcp always for the exporter. I wanted a 2nd pair of eyes to confirm this as this would match what I am seeing in my deployment.

Collector version

0.93.0

Environment information

Environment

OS: Ubuntu 20.04
Using Otel Operator

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@kyleprice kyleprice added bug Something isn't working needs triage New item requiring triage labels Feb 8, 2024
Copy link
Contributor

github-actions bot commented Feb 8, 2024

Pinging code owners:

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

@kyleprice
Copy link
Author

Doesn't look like the link to the line that I think is the issue was added so here it is:

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/syslogexporter/exporter.go#L73

@crobert-1
Copy link
Member

Hello @kyleprice, thanks for filing this issue. The line you referenced is not relevant to your issue, it's simply used for the exporter to batch logs if you're using TCP.

You need to set the insecure option to true in the exporter's TLS settings. It will look like this:

  syslog:
    network: udp
    port: 1500
    endpoint: 10.0.0.2
    retry_on_failure:
      enabled: true
    sending_queue:
      enabled: true
    tls:
      insecure: true

insecure is set to false by default, which overrides the network: udp configuration option and always ends up connecting via tcp. This is expected behavior.

To code owners: Maybe we want to make this more clear in the README for anyone less familiar with these settings?

@crobert-1 crobert-1 added documentation Improvements or additions to documentation and removed bug Something isn't working needs triage New item requiring triage labels Feb 8, 2024
@andrzej-stencel
Copy link
Member

andrzej-stencel commented Feb 8, 2024

Yeah I think the current behavior is very confusing. At the very least, we should document it.

I think we should change the implementation to not use the TLS configuration when UDP is used - or to put it the other way around, only use TLS configuration when TCP is being used. What do you think @crobert-1 @kkujawa-sumo @rnishtala-sumo?

@rnishtala-sumo
Copy link
Contributor

rnishtala-sumo commented Feb 8, 2024

Yes, I agree that it makes sense to remove TLS configuration for UDP since TLS typically operates over TCP.

@crobert-1 crobert-1 added the bug Something isn't working label Feb 8, 2024
@kyleprice
Copy link
Author

Thanks, that fixed it. Appreciate the help!

@andrzej-stencel andrzej-stencel removed the documentation Improvements or additions to documentation label Feb 16, 2024
dmitryax pushed a commit that referenced this issue Feb 27, 2024
**Description:** fix setting network connection, do not load TLS
configuration for UDP

**Link to tracking Issue:** #31130 

**Testing:** unit test, manual tests with syslog server

**Documentation:** added information that TLS config is applied only
when TCP is used

Signed-off-by: Katarzyna Kujawa <[email protected]>
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
**Description:** fix setting network connection, do not load TLS
configuration for UDP

**Link to tracking Issue:** open-telemetry#31130 

**Testing:** unit test, manual tests with syslog server

**Documentation:** added information that TLS config is applied only
when TCP is used

Signed-off-by: Katarzyna Kujawa <[email protected]>
@kasia-kujawa
Copy link
Contributor

The issue was fixed in #31202, it can be closed.

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/syslog
Projects
None yet
Development

No branches or pull requests

5 participants