Ingestion from GCP Pub/Sub
Overview
If you're already reporting events to Google Cloud Platform (GCP) Pub/Sub you can leverage Stigg's native connector to forward these events to Stigg and track feature usage.
Under the hood, the connector leverages a GCP Function designed to actively listen to a Pub/Sub topic, map events to the Stigg event schema format and send them to Stigg in batches at one-second intervals.
Prerequisites
- A project in a GCP account
- A pub/sub topic to consume messages from
- Terraform installed
Getting started
- Enable access for the required APIs on the GCP project
- Clone Stigg's GCP connector repository
- Edit the EventParser.ts file to map between your event format and the Stigg format.
Deployment
- Create a
terraform/terraform.tfvars
file with the following content and fill in the values:gcp_project="" pubsub_topic_id="" stigg_api_key=""
- Change the directory
cd terraform/
- Run
terraform init
to initialize the project - Run
terraform apply -var-file=".tfvars"
to deploy the Cloud Function
Connecting to a metered feature in Stigg
To allow Stigg to meter feature usage based on reported events, an event-based metered feature must exist in Stigg.
If you haven't defined a meter for these events in Stigg yet, click here to learn how to do so.
Example project
Updated 8 months ago