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

Make the Client's connection state observable #98

Open
Paul-E opened this issue Sep 23, 2024 · 0 comments
Open

Make the Client's connection state observable #98

Paul-E opened this issue Sep 23, 2024 · 0 comments

Comments

@Paul-E
Copy link

Paul-E commented Sep 23, 2024

Is your feature request related to a problem? Please describe.

I would like to have observability when the SDK client is connected vs when it is unable to connect to LaunchDarkly when using a streaming connection.

I would like to be able to visualize connection status in my dashboards so that I could observe LaunchDarkly unreachability alongside any other behavior change I see. This allows me to determine if LaunchDarkly connection state is related to what I'm seeing, without needing to proactively needing to check https://status.launchdarkly.com/. Additionally, using the client to determine connection status will also help identify instances where the issue may lie on my own infra.

Describe the solution you'd like

I'd like new status function on the Client struct. The method might return an enum like below

enum Status {
  /// Connection has not been initialized
  Uninitialized,
  /// This client is operating on offline mode
  Offline,
  /// `close` has been called on this connection
  Closed,
  /// The client is currently connected
  Connected,
  /// The client initialized, but is not currently connected
  Disconnected,
}

Then I could poll the status function, and plot a red line on my graphs when the Disconnected variant is returned. If the Connected enum included a network latency value, that would be even better.

Describe alternatives you've considered

I considered passing in a custom connector to data_source, then calling poll_ready, but this would only give me the status of the connector, and not any actual connection. Although, to create a custom connection builder that also also returns a custom connection type.

https://status.launchdarkly.com/ is an alternative, but that data is not available programmatically, and must be monitored by human processes. It also does not identify when an issue may lie on that path between our infra and LaunchDarkly's infra, rather than wholly within LD's infra.

Additional context
Add any other context about the feature request here.

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

No branches or pull requests

1 participant