Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(gcplog): Fix titles for Cloud provisioning for GCP logs #3190

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions docs/sources/clients/promtail/gcplog-cloud.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down