Google Cloud Run
Ship Google Cloud Run logs from Google Cloud Pub/Sub to Logstash
Install Integration
Export Logs to Google Pub/Sub
Ensure that you have Cloud Run logs configured in GCP (opens in a new tab).
Now we can filter the logs as needed, by clicking on the service name and choosing Show matching entries as shown below.
Read more about how to configure and export logs using the Google Operations Console (opens in a new tab)
Create A Sink
To export the logs choose Create sink as shown below.
You will be then be prompted for:
- Sink details (enter a name)
- Sink destination (choose Cloud Pub/Sub topic creating a new topic if needed)
- Choose logs to include in sink (this will have a filter applied already if you filtered the logs above)
Choose Create sink to continue.
Create Google Pub/Sub
Locate your newly created Pub/Sub topic (opens in a new tab) and choose Create subscription.
Enter a suitable Subscription ID and leave the delivery type as pull.
We don't need to change anything further at this stage, scroll to the bottom and choose CREATE to create the Subscription.
Create Service Account
Now in service accounts (opens in a new tab), choose the project you're working with.
Then select CREATE SERVICE ACCOUNT, this account will be used to retrieve logs from the Pub/Sub and send them to Logit.io.
Name the service account and in step 2 add the role Pub/Sub Subscriber as shown below, then choose DONE.
Now choose Manage keys as shown below.
Then choose ADD KEY > Create new key, choosing the recommended JSON format. This will download the JSON key to your machine ready to use in the next step.
Configuring Logstash
To start pulling logs and metrics from the Google Cloud Platform to your Stack you need to configure a Google Cloud Platform Input on your Logit.io Stack.
Go to DashboardLogit.io will verify your input before it is applied, we will contact you to confirm when this has been completed.
Launch Logit.io to view your logs
Data should now have been sent to your Stack.
View My DataIf you don't see take a look at How to diagnose no data in Stack below for how to diagnose common issues.
Cloud Run Logging Overview
Google Cloud Run is a container-as-a-service (CaaS) solution from Google Cloud Platform (GCP), offering the ability to run stateless containers that are invocable via web requests or Pub/Sub events. Similar to platforms like Microsoft Azure Functions and AWS Lambda, Cloud Run is efficient in terms of cost, often being more economical than its counterparts.
Cloud Run maintains a detailed log of operations, user activities, and system messages, providing transparency and aiding in compliance and audit requirements. Emphasis is placed on operational logs for optimal monitoring practices. These logs are essential in troubleshooting and optimizing applications on Cloud Run.
For effective log management, integrating Google Cloud Run logs with analytical tools like Hosted OpenSearch and Kibana through platforms such as Logit.io can offer deep insights, allowing for centralized monitoring across services, including those not hosted on GCP. Pre-set alerts and health checks keep you informed about your containerized applications' status and performance.
You can use Google Cloud Run logs & metrics to visualise the performance of your services in Hosted OpenSearch (opens in a new tab) for intelligent reporting & by using our log analysis platform (opens in a new tab) you can correlate the performance of your Cloud Run Services with the rest of your applications (even those based outside of Google services).
If you need any assistance with analysing your Google Cloud Compute logs we're here to help. Feel free to reach out by getting in contact with us via live chat and we'll be happy to help you start analysing your Cloud Compute data.