• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
No results for ""
EXPAND ALL

EDIT ON GITHUB

Google Cloud Pub/Sub

Read time: 2 minutes
Last edited: Oct 26, 2021

Overview

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

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.

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.

Verify you see the LaunchDarkly Service account email as a Pub/Sub Publisher. If you configured your account correctly, LaunchDarkly's Service Account email appears as a Pub/Sub Publisher.

Here is an image of the Pub/Sub topic list:

The Pub/Sub topic list with the LaunchDarkly Service account email called out.
The Pub/Sub topic list with the LaunchDarkly Service account email called out.

Connecting the Pub/Sub topic to LaunchDarkly

The final step is to connect your topic to LaunchDarkly. To do this:

  1. Log into LaunchDarkly.
  2. Navigate to the Integrations page and find the Google Cloud Pub/Sub card.
  3. Click + Integration. The integration screen appears.
  4. (Optional) Enter a Name for the destination.
  5. Choose an environment from the Environment drop-down list.
  6. Enter the Topic ID.
  7. Enter the Project ID.
  8. Click Save destination:

The Pub/Sub Create a destination screen.
The Pub/Sub Create a destination screen.

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. From the Integrations page, click the edit button on the GoogleCloud Sub/Pub card. The Edit destination screen appears.
  2. In the Send a test event section, click Send Event.
  3. If you have configured the destination correctly, an event is logged in the Google Cloud Pub/Sub destination.

The Send a test event screen.
The Send a test event screen.

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.