# Google Cloud Logging

Project logs through a Pub/Sub push subscription.

Logs Available

[Open the Connect card in Epok](https://app.epok.cloud/#/connect?source=gcp-logs) [Full setup guide](https://epok.cloud/docs/running-on-gcp#pubsub)

## What you get

Logs, arriving through Logs Router sink and Pub/Sub push (OIDC).

## Set it up

1. Create an ingest key in Epok: Settings, then API keys.
2. Download gcp.sh from the setup page (or use the Terraform module), read it, and run it for your project.
3. It creates a Logs Router sink, a Pub/Sub topic with a dead-letter topic, and a push subscription that signs each delivery with a Google OIDC token.
4. Run the data-arrived check from the setup page, then search for the logs in Explore.

The commands and configuration for each step are on the [setup guide](https://epok.cloud/docs/running-on-gcp#pubsub).

## What was tested

- The published setup, run against a local copy of Epok's ingest stack: 1 run.
- End to end with real cloud resources, sending to a local Epok stack rather than the hosted service: 1 run.
- Code tests of the ingest route or the sender: 2 tests.
- No run against the hosted service is recorded yet.

## What you see in Epok

- Explore and Live tail: search, patterns and new errors.

## Troubleshooting

- Epok answers 403 when the subscription's token audience differs from its push endpoint. Re-run gcp.sh to fix it.
- Nothing reaches the topic when the sink's writer identity lacks the publisher role on it. Re-run gcp.sh; the grants are idempotent.
- A new sink can drop entries for its first minutes.

## More in Cloud & Kubernetes

[Container logs](https://epok.cloud/integrations/k8s-container-logs) [Kubernetes events](https://epok.cloud/integrations/k8s-events) [Node, pod and cluster metrics](https://epok.cloud/integrations/k8s-metrics) [Traces from your pods](https://epok.cloud/integrations/k8s-traces) [EC2](https://epok.cloud/integrations/aws-ec2) [CloudWatch Logs](https://epok.cloud/integrations/aws-cloudwatch-logs) [CloudWatch metrics](https://epok.cloud/integrations/aws-cloudwatch-metrics) [Lambda](https://epok.cloud/integrations/aws-lambda) [ECS on Fargate](https://epok.cloud/integrations/aws-ecs-fargate) [Compute Engine](https://epok.cloud/integrations/gcp-compute-engine) [Cloud Run](https://epok.cloud/integrations/gcp-cloud-run)
