Skip to main content

Pub/Sub

  • Alerts triggered by Pulse will be forwarded to Pub/Sub and pulled by or pushed to subscribers.

Pulse events that arise from metrics that go beyond threshold, anomaly detection, misconfiguration etc of monitored clusters send an event to a Pub/Sub topic. This topic can then be subscribed to by push subscriptions or pull subscriptions. See https://cloud.google.com/pubsub/docs/how-to.

  • You will need access to view the specific cluster in Pulse. If you do not have this access, contact an Admin or Account Owner within your organization to configure the integration.
  • Pulse requires the topic id and the project id to write to as well as credentials with a permission to publish to that topic. Alerts and incidents must be enabled for the cluster in Pulse.

Follow these steps to integrate with Pub/Sub. The links to GCP documentation explain how to create the relevant assets in the console. In the bottom of this page you will also find relevant terraform code.

  1. Create a Pub/Sub topic and add subscribers as necessary. Document the name of the Pub/Sub topic. You can do this via the console as explained here: Create and use topics.
  2. Create or use an existing service account, and get a service account key: Creating and managing service accounts, Create a service account key . From this process you will get a .json file. Produce a base64 encoded string of it by running: base64 credentials.json
  3. Give the service account the "roles/pubsub.publisher" role permission for the topic. Access control with IAM
  4. You can similarly create a subscriber. You'll need the "roles/pubsub.subscriber" role. Create and use subscriptions

  1. Log in to Pulse and navigate to the monitored cluster.
  2. On the Dashboards section, Settings > Alerting Destinations.
  3. If no Pub/Sub destination exists, click + Pub/Sub.
  4. Ensure you have set up your Pub/Sub topic and credentials as described in Set Up Pub/Sub.
  5. Provide the Topic ID, the Project ID and the Base64-encoded Service Account Key created in the previous section.
  6. Set the desired alert severity to trigger Pub/Sub notifications (recommended: critical only).
  7. Click Save Changes.

Add Pub/Sub Alert Destination

Follow these steps to disable the Pub/Sub alerting destination in the Pulse Console.

  1. Log in to Pulse and navigate to the monitored cluster.
  2. On the Dashboards section, Settings > Alerting Destinations.
  3. Disable the Pub/Sub Alerting Destination by toggling the "enabled" toggle.
  4. Click Save Changes.

Disable Pub/Sub Alert Destination

Follow these steps to uninstall the Pub/Sub alerting destination from the Pulse Console.

  1. Log in to Pulse and navigate to the monitored cluster.
  2. On the Dashboards section, Settings > Alerting Destinations.
  3. Remove the Pub/Sub Alerting Destination by clicking X.
  4. Click Save Changes.

Remove Pub/Sub Alert Destination

Terraform code

main.tf:

provider "google" {
region = var.gcp_region
project = var.project_id
}

resource "google_pubsub_topic" "pulse_alert_test" {
name = var.topic_name
}


resource "google_pubsub_subscription" "pulse_alert_subscription" {
topic = google_pubsub_topic.pulse_alert_test.name
name = var.subscription_name
}

iam.tf:


resource "google_service_account" "pubsub-reader" {
account_id = var.reader_account_id
display_name = "Pulse Pubsub"
}

resource "google_service_account" "pubsub-writer" {
account_id = var.writer_account_id
display_name = "Pulse Pubsub"
}
## Keys
resource "google_service_account_key" "pubsub-reader" {
service_account_id = google_service_account.pubsub-reader.name
}

resource "google_service_account_key" "pubsub-writer" {
service_account_id = google_service_account.pubsub-writer.name
}


resource "google_pubsub_subscription_iam_member" "member" {
project = google_pubsub_topic.pulse_alert_test.project
subscription = google_pubsub_subscription.pulse_alert_subscription.name
role = "roles/pubsub.subscriber"
member = "serviceAccount:${google_service_account.pubsub-reader.email}"
}

resource "google_pubsub_topic_iam_member" "member" {
project = google_pubsub_topic.pulse_alert_test.project
topic = google_pubsub_topic.pulse_alert_test.name
role = "roles/pubsub.publisher"
member = "serviceAccount:${google_service_account.pubsub-writer.email}"
}

--

For support please contact hello@pulse.support.