Compute@Edge log streaming: Google Cloud Pub/Sub

Fastly's Real-Time Log Streaming feature for Compute@Edge services can send log files to Cloud Pub/Sub, Google's global messaging and event data ingestion product.

Prerequisites

Before adding Cloud Pub/Sub as a logging endpoint for Fastly Compute@Edge services, you will need to register for a Google Cloud Platform (GCP) account and then:

  • Create a service account on Google's website.
  • Navigate to the Pub/Sub section of the Google Cloud console. Follow the prompts to enable the API.
  • Create a Pub/Sub topic.
  • Obtain the private key from the JSON file associated with the service account configured for your Pub/Sub topic.

Adding Cloud Pub/Sub as a logging endpoint

Follow these instructions to add Cloud Pub/Sub as a logging endpoint:

  1. Review the information in our Setting Up Remote Log Streaming guide.

  2. Click the Google Cloud Pub/Sub Create endpoint button. The Create a Google Cloud Pub/Sub endpoint page appears.
  3. Fill out the Create a Google Cloud Pub/Sub endpoint fields as follows:
    • In the Name field, enter the name you specified in your Compute@Edge code. For example, in our Rust code example, the name is my_endpoint_name.
    • In the Project ID field, enter the ID of your Google Cloud Platform project.
    • In the Email field, enter the email address of the service account configured for your Pub/Sub topic.
    • In the Topic field, enter the Pub/Sub topic to which logs should be sent.
    • In the Secret Key field, enter the exact value of the private key associated with the service account configured for your Pub/Sub topic.
  4. Click the Create button to create the new logging endpoint.
  5. Click the Activate button to deploy your configuration changes.
Back to Top