Skip to content

Make the Client's connection state observableΒ #98

@Paul-E

Description

@Paul-E

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions