diff --git a/docs/sources/clients/promtail/gcplog-cloud.md b/docs/sources/clients/promtail/gcplog-cloud.md index 4b56431f2a42..25236ee16140 100644 --- a/docs/sources/clients/promtail/gcplog-cloud.md +++ b/docs/sources/clients/promtail/gcplog-cloud.md @@ -1,16 +1,20 @@ --- -title: Cloud setup for gcplog TargetManager +title: Cloud setup GCP Logs --- +# Cloud setup GCP logs + This document explain how one can setup Google Cloud Platform to forward its cloud resource logs from a particular GCP project into Google Pubsub topic so that is available for Loki promtail to consume. This document assumes, that reader have `gcloud` installed and have required permissions(as mentioned in #[Roles and Permission] section) -# Roles and Permission +## Roles and Permission + User should have following roles to complete the setup. - "roles/pubsub.editor" - "roles/logging.configWriter" -# Setup Pubsub Topic +## Setup Pubsub Topic + Google Pubsub Topic will act as the queue to persist log messages which then can be read from `promtail`. ```bash @@ -22,7 +26,8 @@ e.g: $ gcloud pubsub topics create cloud-logs ``` -# Setup Log Router +## Setup Log Router + We create a log sink to forward cloud logs into pubsub topic created before ```bash @@ -39,7 +44,8 @@ $ gcloud beta logging sinks create cloud-logs pubsub.googleapis.com/projects/my- Above command also adds `log-filter` option which represents what type of logs should get into the destination `pubsub` topic. For more information on adding `log-filter` refer this [document](https://cloud.google.com/logging/docs/export/configure_export_v2#creating_sink) -# Create Pubsub subscription for Loki +## Create Pubsub subscription for Loki + We create subscription for the pubsub topic we create above and `promtail` uses this subscription to consume log messages. ```bash @@ -57,7 +63,8 @@ $ gcloud pubsub subscriptions create cloud-logs --topic=pubsub.googleapis.com/pr For more fine grained options, refer to the `gcloud pubsub subscriptions --help` -# ServiceAccount for Promtail +## ServiceAccount for Promtail + We need a service account with following permissions. - pubsub.subscriber