ld-relay

command module
v6.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

LaunchDarkly Relay Proxy

Circle CI

What does the LaunchDarkly Relay Proxy do?

The LaunchDarkly Relay Proxy establishes a connection to the LaunchDarkly streaming API, then proxies that stream connection to multiple clients. It lets a number of servers connect to a local stream instead of making a large number of outbound connections to stream.launchdarkly.com.

You can configure the Relay Proxy to proxy multiple environment streams, even across multiple projects. You can also use it as a local proxy that forwards events to events.launchdarkly.com. This can be useful if you are load balancing Relay Proxy instances behind a proxy that times out HTTP connections (for example, Elastic Load Balancers).

When should I use the LaunchDarkly Relay Proxy?

To learn more about appropriate use cases for the Relay Proxy, read Should I use the Relay Proxy?.

Getting started

To learn more about setting up the Relay Proxy, read Starting the Relay Proxy.

Capabilities

In the most basic configuration, the Relay Proxy simulates the LaunchDarkly service endpoints that LaunchDarkly SDKs use. The SDKs can connect to the Relay Proxy as if it were LaunchDarkly. To learn more, read Proxy Mode.

You can also have the Relay Proxy put feature flag data into a database and have the SDKs use that database instead of making HTTP requests. To learn more, read Daemon Mode.

If you provide a mobile key and/or a client-side environment ID in the configuration for an environment, the Relay Proxy can also accept connections from mobile clients and/or JavaScript clients. To learn more, read Client-Side/Mobile Connections.

If you enable event forwarding in the configuration, the Relay Proxy accepts analytics events from SDKs and forwards them to LaunchDarkly. To learn more, read Event Forwarding.

There are some special considerations if you use the PHP SDK. To learn more, read Using PHP.

Enterprise capabilities

LaunchDarkly offers additional Relay Proxy features to customers on Enterprise plans.

Automatic configuration automatically detects when environments are created and updated, removing the need for most manual configuration file changes and application restarts. Instead, you can use a simple in-app UI to manage your Relay Proxy configuration. To learn more, read Automatic configuration.

Offline mode lets you run the Relay Proxy without ever connecting it to LaunchDarkly. When running in offline mode, the Relay Proxy gets flag and segment values from an archive on your filesystem, instead of contacting LaunchDarkly's servers. To learn more, read Offline mode.

If you want access to these features but don’t have a LaunchDarkly Enterprise plan, then contact our sales team to upgrade.

Deployment options

A common way to run the Relay Proxy is as a Docker container. To learn more, read Using with Docker.

You can also run it as a Windows service. To learn more, read Building and Running in Windows.

Or, you can build the Relay Proxy endpoints into your own application. To learn more, read Building Within an Application.

Command-line arguments

Argument Description
--config FILEPATH configuration file location
--allow-missing-file if specified, a --config option for a nonexistent file will be ignored
--from-env if specified, configuration will be read from environment variables

If none of these are specified, the default is --config /etc/ld-relay.conf.

Specifying a configuration

There are many configuration options, which can be specified in a file, in environment variables, or both.

To learn more, read Configuration.

Persistent storage

You can configure Relay Proxy nodes to persist feature flag settings in Redis, DynamoDB, or Consul.

To learn more, read Persistent Storage.

Exporting metrics and traces

The Relay Proxy may be configured to export statistics and route traces to Datadog, Stackdriver, and Prometheus.

To learn more, read Metrics Integrations.

Logging

To learn more, read Logging.

Service endpoints

The Relay Proxy defines many HTTP/HTTPS endpoints. Most of these are proxies for LaunchDarkly services, to be used by SDKs that connect to the Relay Proxy. Others are specific to the Relay Proxy, such as for monitoring its status.

To learn more, read Service Endpoints.

Performance, scaling, and operations

We have done extensive load tests on the Relay Proxy in AWS/EC2. We have also collected a substantial amount of data based on real-world customer use. Based on our experience, we have several recommendations on how to best deploy, operate, and scale the Relay Proxy:

  • Networking performance is the most important consideration. Memory and CPU are not as critical. Deploy the Relay Proxy on boxes with good networking performance. On EC2, we recommend using an instance with Moderate to High networking performance such as m4.xlarge. On an m4.xlarge instance, a single Relay Proxy node can easily manage 20,000 concurrent connections.

  • If you use an Elastic Load Balancer in front of the Relay Proxy, you may need to pre-warm the load balancer whenever connections to the Relay Proxy cycle. This might happen when you deploy a large number of new servers that connect to the Relay Proxy, or upgrade the Relay Proxy itself.

To learn more, read Testing Relay Proxy performance.

Contributing

We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this project.

About LaunchDarkly

  • LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
    • Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
    • Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
    • Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
    • Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
  • LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out our documentation for a complete list.
  • Explore LaunchDarkly

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package config defines the standard configuration schema supported by all versions of Relay.
Package config defines the standard configuration schema supported by all versions of Relay.
Package integrationtests defines end-to-end integration tests between a Relay instance and the LD services (normally the staging ones).
Package integrationtests defines end-to-end integration tests between a Relay instance and the LD services (normally the staging ones).
internal
autoconfig
Package autoconfig contains a client for the auto-configuration streaming service.
Package autoconfig contains a client for the auto-configuration streaming service.
basictypes
Package basictypes contains types and constants that are used by multiple Relay packages and do not have any testable logic of their own.
Package basictypes contains types and constants that are used by multiple Relay packages and do not have any testable logic of their own.
core
Package core contains Relay Proxy core implementation components and internal APIs.
Package core contains Relay Proxy core implementation components and internal APIs.
core/application
Package application providers helpers used by the command-line entry points of all versions of Relay.
Package application providers helpers used by the command-line entry points of all versions of Relay.
core/bigsegments
Package bigsegments contains logic for synchronizing big segments.
Package bigsegments contains logic for synchronizing big segments.
core/httpconfig
Package httpconfig provides helpers for special types of HTTP client configuration supported by Relay.
Package httpconfig provides helpers for special types of HTTP client configuration supported by Relay.
core/internal/browser
Package browser contains internal helpers that are only used for browser requests.
Package browser contains internal helpers that are only used for browser requests.
core/internal/events
Package events contains the internal implementation of event forwarding.
Package events contains the internal implementation of event forwarding.
core/internal/metrics
Package metrics implements Relay's integration with OpenCensus.
Package metrics implements Relay's integration with OpenCensus.
core/internal/store
Package store contains the internal implementation of how Relay interacts with the SDK's DataStore to detect data updates.
Package store contains the internal implementation of how Relay interacts with the SDK's DataStore to detect data updates.
core/logging
Package logging provides logging-related helpers.
Package logging provides logging-related helpers.
core/middleware
Package middleware contains helpers for adding standard behavior like authentication and metrics to REST endpoints.
Package middleware contains helpers for adding standard behavior like authentication and metrics to REST endpoints.
core/relayenv
Package relayenv contains the internal interface and implementation of EnvConfig, the object that manages Relay state for a specific configured LD environment.
Package relayenv contains the internal interface and implementation of EnvConfig, the object that manages Relay state for a specific configured LD environment.
core/sdks
Package sdks contains types and helpers for describing the behavior of different kinds of SDKs that can connect to Relay, and also for Relay's own use of the Go SDK.
Package sdks contains types and helpers for describing the behavior of different kinds of SDKs that can connect to Relay, and also for Relay's own use of the Go SDK.
core/sharedtest
Package sharedtest provides helper code and test data that may be used by tests in all Relay components and distributions.
Package sharedtest provides helper code and test data that may be used by tests in all Relay components and distributions.
core/sharedtest/testclient
Package testclient contains test helpers that reference the SDK-related packages.
Package testclient contains test helpers that reference the SDK-related packages.
core/sharedtest/testenv
Package testenv contains test helpers that reference the relayenv package.
Package testenv contains test helpers that reference the relayenv package.
core/sharedtest/testsuites
Package testsuites contains shared test suites that should be run against every version of Relay to validate the behavior of the core code.
Package testsuites contains shared test suites that should be run against every version of Relay to validate the behavior of the core code.
core/streams
Package streams defines the Relay core abstractions for implementing streaming endpoints, and provides some standard implementations for those endpoints.
Package streams defines the Relay core abstractions for implementing streaming endpoints, and provides some standard implementations for those endpoints.
envfactory
Package envfactory contains types related to service-driven environment configuration, shared by the autoconfig and filedata packages.
Package envfactory contains types related to service-driven environment configuration, shared by the autoconfig and filedata packages.
filedata
Package filedata contains logic for reading a file data source.
Package filedata contains logic for reading a file data source.
util
Package util provides general helpers used by Relay code.
Package util provides general helpers used by Relay code.
Package relay contains the basic implementation of the Relay application.
Package relay contains the basic implementation of the Relay application.
version
Package version exists only to hold the current version string for Relay, which is updated by the release script.
Package version exists only to hold the current version string for Relay, which is updated by the release script.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL