Google Cloud API Gateway Logging

Created:
April 12, 2024
Updated:
September 19, 2024

The Google Cloud API Gateway Logging integration enables you to send API Gateway logs from Google Cloud Platform (GCP) to FireTail. This helps you keep track of API traffic, performance, and security using FireTail's logging and analysis tools. By having detailed log data continuously sent to FireTail, you get better insights into how your APIs are working, making it easier to spot and fix problems faster.

To set up the integration, follow the steps below to deploy the necessary resources.

1. Navigate to Integrations in the FireTail platform.

2. Select the Create Integration tab.

3. Click Google Cloud API Gateway Logging.

4. Select an existing GCP API Gateway from the dropdown menu.

5. Generate an app token.

6. Go to https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/firetail-io/firetail-google-apigateway-logging-cloud-function. You will need to indicate that you trust the repo.

7. When the Cloud Shell editor is open, first run the below script to authenticate:


gcloud auth login

8. Follow any prompts in the editor to complete authentication.

9. Run the below script in the editor:

EU Prod


./run.sh --ft-logging-endpoint=https://api.logging.eu-west-1.prod.firetail.app
--ft-app-token=<> 
--gcp-region={region} --gcp-gateway-id={gateway_id} 
--gcp-project-num={project_number} --gcp-resource-prefix=ft-logging-{gateway_id}

US Prod


./run.sh --ft-logging-endpoint=https://api.logging.us-east-2.prod.us.firetail.app
--ft-app-token=<> 
--gcp-region={region} --gcp-gateway-id={gateway_id} 
--gcp-project-num={project_number} --gcp-resource-prefix=ft-logging-{gateway_id}

Note: The following information must be inputted into the script:

  • FireTail App token - copy the token you generated.
  • project_number - The Project number is a numerical value, found on the homepage of the GCP console.
  • gateway_id - In the GCP console, open API Gateway, select the gateway and retrieve the Gateway ID.
  • region - In the GCP console, open API Gateway, select the gateway, the region is the location.

Example


./run.sh --ft-logging-endpoint=https://api.logging.eu-west-1.prod.firetail.app
--ft-app-token=FTA-01-1234567890
--gcp-region={europe-west2} --gcp-gateway-id=mygatewayid 
--gcp-project-num={123456789} --gcp-resource-prefix=ft-logging-mygatewayid