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

Warn when enabling socket_telemetry on unsupported platform #23

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

Conversation

stevenharman
Copy link
Contributor

The structs we depend on for collecting socket telemetry (SOL_TCP and TCP_INFO) don't exist on all platforms. In such cases, these constants won't be defined, and so we should WARN users and not enabled the socket_telemetry option.

NOTE: On macOS, similar structs do exist: Socket::IPPROTO_TCP and Socket::TCP_CONNECTION_INFO, respectively, but I couldn't figure out the binary layout of the data, so couldn't unpack it. Maybe someone else knows more about those details and can dig in at some point.

@stevenharman stevenharman force-pushed the handle_socket_telemetry_on_macos branch from 9e6a3cd to 5746684 Compare May 13, 2024 13:36
Comment on lines -126 to +130
expect(possible_lines.include?(line)).to eq(true)
expect(possible_lines).to include(line)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will result in a more useful error message if the line doesn't match.

@stevenharman stevenharman force-pushed the handle_socket_telemetry_on_macos branch from 5746684 to 04b2f10 Compare May 14, 2024 00:24
@stevenharman
Copy link
Contributor Author

Anyone opposed to this one? It's a nice experience improvement - certainly better than blowing up!

The structs we depend on for collecting socket telemetry (`SOL_TCP` and
`TCP_INFO`) don't exist on all platforms. In such cases, these constants
won't be defined, and so we should WARN users and not enabled the
`socket_telemetry` option.

NOTE: On macOS, similar structs do exist: `Socket::IPPROTO_TCP` and
`Socket::TCP_CONNECTION_INFO`, respectively, but I couldn't figure out
the binary layout of the data, so couldn't unpack it. Maybe someone else
knows more about those details and can dig in at some point.
@stevenharman stevenharman force-pushed the handle_socket_telemetry_on_macos branch from 04b2f10 to 469ccaf Compare July 3, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants