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]: fix setting network connection #31202

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

kasia-kujawa
Copy link
Contributor

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

Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with both UDP and TCP, works like a charm 👌 Thank you!

@@ -78,8 +78,8 @@ func (s *sender) dial() error {
s.conn = nil
}
var err error
if s.tlsConfig != nil {
s.conn, err = tls.Dial("tcp", s.addr, s.tlsConfig)
if s.tlsConfig != nil && s.network == "tcp" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe a constant for "tcp" would be ideal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a new pull request to change tcp/udp strings into constants, we use these strings in several places.

Copy link
Contributor

@rnishtala-sumo rnishtala-sumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! minor comment on tcp/udp strings

do not load TLS configuration for UDP

Signed-off-by: Katarzyna Kujawa <kkujawa@sumologic.com>
@dmitryax dmitryax merged commit f825274 into open-telemetry:main Feb 27, 2024
142 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 27, 2024
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request 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 <kkujawa@sumologic.com>
codeboten added a commit that referenced this pull request May 1, 2024
use consts for network
protocol names, changes were suggested in
#31202 (comment)

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

---------

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/syslog ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants