No results for ""
EXPAND ALL
  • Home
  • API docs

Google Cloud Pub/Sub

Read time: 3 minutes
Last edited: Oct 16, 2024

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.

In this example, the projectId is ld-pubsub-test-192301 and the topicId is test-prod:

The projectId and topicId in the Google Cloud Pub/Sub topic list.
The projectId and topicId in the Google Cloud Pub/Sub topic list.

Grant 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. When you choose a topic, Permissions options appear.
  3. Enter LaunchDarkly’s Service Account email, prod-event-recorder@firehose-publish.iam.gserviceaccount.com, into the Add Members field.
  4. Click the Select a Role menu and choose "Pub/Sub Publisher."
  5. Click Add.

Verify that the LaunchDarkly Service account email is 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.

Connect the Pub/Sub topic to LaunchDarkly

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

  1. In LaunchDarkly, navigate to the Integrations page and find "Google Cloud Pub/Sub."
  2. Click Add integration. The "Create a destination" panel appears.
  3. (Optional) Enter a Name for the destination.
  4. Choose an environment from the Environment menu.
  5. Enter the Topic ID.
  6. Enter the Project ID.
  7. Click Save destination.

Test a Google Cloud Pub/Sub destination

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

To send a test event:

  1. Navigate to the Integrations page and find "Google Cloud Pub/Sub."
  2. Click into the "GoogleCloud Sub/Pub" section to display a list of destinations.
  3. Click the pencil icon next to the destination you want to test. The "Edit destination" panel appears.
  4. In the "Send a test event" section, click Send event.
  5. If you have configured the destination correctly, an event is logged in the Google Cloud Pub/Sub destination.

Enable 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, read Export event data for flags and environments.

Delete 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 page and find "Google Cloud Pub/Sub."
  2. Click into the "GoogleCloud Sub/Pub" section to display a list of destinations.
  3. Click the pencil icon next to the destination you wish to delete. The "Edit destination" panel appears.
  4. Click Delete destination.