LaunchDarkly Developer Documentation

Get started in under 30 minutes.
LaunchDarkly provides feature flags as a service for Java · Python · Ruby · Go · Node.js · PHP · .NET. Control feature launches -- who sees what and when -- without multiple code deploys. Easy dashboard for phased rollouts, targeting and segmenting.
Need more help? write us at support@launchdarkly.com

Get Started    Documentation

Google Cloud Pub/Sub

Overview

Google Cloud Pub/Sub destinations let you export all of the flag evaluation and event data generated by LaunchDarkly SDKs into a Google Cloud Pub/Sub topic. This export behavior is referred to as publishing.

This topic explains how to create a Google Cloud Pub/Sub destination.

Prerequisites

In order for LaunchDarkly to send events to your Google Cloud Pub/Sub topic, you need the projectId and topicId for the Google Cloud Pub/Sub topic to which you want us to publish.

Find this information in the Google Cloud Pub/Sub topic list, as pictured below.

After picking the topic, you can find the projectId and topicId.

After picking the topic, you can find the projectId and topicId.

Granting Publish Access to LaunchDarkly

After you identify the Pub/Sub topic you wish to publish to, you must grant LaunchDarkly's Google Cloud Service Account publish access to that topic.

To grant publish access:

  1. In your Google Cloud Console, navigate to the Pub/Sub topic list.
  2. Select a topic by clicking the checkboxes to the left of each topic name. Once you choose a topic, Permissions options appear.
  3. Paste LaunchDarkly’s Service Account email: prod-event-recorder@firehose-publish.iam.gserviceaccount.com into the Add Members field.
  4. Click the Select a Role dropdown and choose "Pub/Sub Publisher".
  5. Click Add.

If you configured your account correctly, our Service Account email appears as a Pub/Sub Publisher, as pictured below.

Verify you see the LaunchDarkly Service account email as a Pub/Sub Publisher.

Verify you see the LaunchDarkly Service account email as a Pub/Sub Publisher.

Connecting the Pub/Sub Topic to LaunchDarkly

The final step is to connect your topic to LaunchDarkly.

  1. Log into LaunchDarkly.
  2. Click into the Integrations page.
  3. Click on the Google Cloud Pub/Sub icon or, if this is not your first destination, click the Add Destination drop down.
Click on the Google Cloud Pub/Sub card or the Add destination drop down

Click on the Google Cloud Pub/Sub card or the Add destination drop down

  1. Enter a Name for the destination.
  2. Choose an Environment from the drop-down list.
  3. Enter the Topic ID.
  4. Enter the Project ID.
  5. Click Save Destination.
Add the `projectId` and `topicId` as noted from Google Cloud. Choose an appropriate name and environment.

Add the projectId and topicId as noted from Google Cloud. Choose an appropriate name and environment.

Testing the Google Cloud Pub/Sub Destination

After you've saved the destination, send a test event to confirm that the destination is configured properly.

  1. In the Send a test event section, click Send Event.
  2. If you have configured the destination correctly, an event is logged in the Google Cloud Pub/Sub destination.
Send a test event to your topic

Send a test event to your topic

Enabling data export for flags and environments

After you create a data export destination, you must start sending flag or environment event data to it. You can enable data export for individual flags, or for all the flags in an environment.

To learn more about exporting event data from flags and environments, read Exporting event data for flags and environments.

Deleting a Google Cloud Pub/Sub destination

You can delete a data export destination from the Integrations screen.

To delete a destination:

  1. Navigate to the Integrations screen.
  2. Find the destination you wish to delete and click Edit. The "Create a destination" screen opens.
  3. Click Delete Destination.
The Delete destination section.

The Delete destination section.


What's Next

Schema reference

Google Cloud Pub/Sub


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.