---
title: Integrate LaunchDarkly with the Python agent
source: https://docs.newrelic.com/docs/apm/agents/python-agent/supported-features/launchdarkly-release-observability
---

> #### 💡 PREVIEW
>
> We're still working on this feature, but we'd love for you to try it out!
>
> This feature is currently provided as part of a preview program pursuant to our [pre-release policies](https://docs.newrelic.com/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy).

The New Relic Python agent integrates with LaunchDarkly feature management so you can observe how feature flags and releases affect your application. This integration uses the LaunchDarkly observability plugin and OpenTelemetry support in the Python agent to connect your LaunchDarkly data with your New Relic APM data.

This document explains how to install the required packages and enable the integration.

## Prerequisites [#prerequisites]

Before you begin, make sure you have:

-   A New Relic [license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key)
-   A LaunchDarkly account and license
-   An application written in Python and monitored with the [New Relic Python APM agent](https://docs.newrelic.com/docs/apm/agents/python-agent/installation/install-new-relic-python-agent)
-   Access to the LaunchDarkly OpenTelemetry (OTel) beta

## Installation and configuration [#install]

### Install the required packages [#install-packages]

Install the following Python packages within the same environment as the application:

-   `newrelic`
-   `launchdarkly-observability`

```bash
pip install newrelic launchdarkly-observability
```

The following packages are also required and typically install automatically as dependencies of `launchdarkly-observability`:

-   `opentelemetry-api`
-   `launchdarkly-eventsource`
-   `launchdarkly-server-sdk`
-   `launchdarkly-server-sdk-otel`

If these dependencies are not installed automatically, install them manually using `pip`:

```bash
pip install opentelemetry-api launchdarkly-eventsource launchdarkly-server-sdk launchdarkly-server-sdk-otel
```

### Enable the integration [#enable-integration]

To enable the integration, set both `launch_darkly_integration.enabled` and `opentelemetry.enabled` to `true`. Select one of the following configuration methods to configure the application:

**Use newrelic.ini**

Add the following to your `newrelic.ini` file:

```ini
launch_darkly_integration.enabled = true
opentelemetry.enabled = true
```

**Use pyproject.toml**

Add the following to your `pyproject.toml` file:

```toml
[tool.newrelic]
launch_darkly_integration.enabled = true
opentelemetry.enabled = true
```

**Use environment variables**

Set the following environment variables:

```bash
export NEW_RELIC_LAUNCH_DARKLY_ENABLED=true
export NEW_RELIC_OPENTELEMETRY_ENABLED=true
```

> #### 💡 TIP
>
> For more information about the OpenTelemetry setting, see the [Python agent configuration](https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration#opentelemetry-enabled) documentation.

### Verify the integration [#verify]

After enabling these settings, restart the application so the Python agent loads the updated configuration. Next, generate test traffic and verify that the application continues reporting data in [**APM & services**](https://docs.newrelic.com/docs/apm/apm-ui-pages/monitoring/apm-summary-page-view-transaction-apdex-usage-data).

## What's next [#whats-next]

-   Learn more about [OpenTelemetry API support in the New Relic agents](https://docs.newrelic.com/docs/apm/agents/manage-apm-agents/opentelemetry-api-support).
-   Review all [Python agent configuration options](https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration).
