For the complete documentation index, see llms.txt. Markdown versions are available by appending .md to documentation URLs.

Collect GCP Cloud Logging Logs with Pub/Sub in SigNoz

SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Hosted Enterprise - This page applies to self-hosted SigNoz with an active license.

GCP services write their logs to Cloud Logging. This guide sends the logs you pick to SigNoz. This is step 5 of the GCP integration.

Logs travel like this:

  1. A log sink in each monitored project picks the logs you want.
  2. The sink sends them to a Pub/Sub topic in your deployment project.
  3. A push subscription sends each message to the Collector.
  4. The Collector sends the logs to SigNoz.

The architecture diagram on the overview page shows this path.

Prerequisites

  • The Collector is deployed as a Cloud Run service and runs otel/opentelemetry-collector-contrib 0.163.1 or later. Older versions don't include the receiver that accepts Pub/Sub messages.
  • The Pub/Sub API and Cloud Logging API are enabled in your deployment project, and the Cloud Logging API is enabled in each monitored project. See Enable the required APIs.

Step 1: Add the logs receiver to the Collector

Open the otel-collector-config.yaml you created in Deploy the Collector and make these changes. Keep your existing metrics receiver, processors, and exporter as they are.

  • Add the googlecloudpubsubpush receiver on port 8080.
  • Add the google_cloud_logentry_encoding extension.
  • Move health_check from port 8080 to port 13133. Two components can't listen on the same port, and 8080 now belongs to the logs receiver.
  • Add a logs pipeline.
otel-collector-config.yaml
receivers:
  # Accepts log messages that Pub/Sub pushes to the Collector.
  googlecloudpubsubpush:
    endpoint: 0.0.0.0:8080
    encoding: google_cloud_logentry_encoding
 
extensions:
  health_check:
    endpoint: 0.0.0.0:13133   # was 0.0.0.0:8080
    path: /healthz
  # Reads the Cloud Logging format and keeps GCP labels as attributes.
  google_cloud_logentry_encoding:
 
service:
  extensions: [health_check, google_cloud_logentry_encoding]
  pipelines:
    logs:
      receivers: [googlecloudpubsubpush]
      processors: [memory_limiter, batch]
      exporters: [otlphttp]

Apply the change:

  1. Add a new secret version (step 2 of Deploy the Collector).
  2. Redeploy the Cloud Run service (step 3). If your image tag is older than 0.163.1, change it to 0.163.1 or later in the same redeploy.
  3. In the Cloud Run logs, check for Everything is ready. Begin running and processing data.

Step 2: Copy the Collector URL

Pub/Sub sends logs to the Collector's Cloud Run URL. It looks like https://signoz-integration-collector-xxxxxxxxxx-uc.a.run.app.

  1. In the deployment project, go to Cloud Run and open the signoz-integration-collector service.
  2. Copy the URL shown at the top of the page.

You use this value as <collector-service-url> in step 5.

Step 3: Create the Pub/Sub topic

Create one topic in your deployment project. All log sinks send to this topic.

  1. Select your <deployment-project-id> in the project picker.
  2. Go to Pub/Sub > Topics > Create topic.
  3. Set Topic ID to signoz-integration_logs_push.
  4. Clear Add a default subscription. You create the subscription in step 5.
  5. Click Create.

The full topic name is projects/<deployment-project-id>/topics/signoz-integration_logs_push. You need it when you create sinks in other projects.

Step 4: Allow Pub/Sub to call the Collector

The Collector only accepts signed-in requests. Pub/Sub signs in as the signoz-integration-collector service account. Give that account permission to call the Collector, and let Pub/Sub create sign-in tokens for it.

  1. Allow calls to the Collector: Go to Cloud Run. In the services list, select the checkbox next to signoz-integration-collector (don't open the service). In the info panel on the right, open Permissions (click Show Info Panel if it's hidden), then click Add principal. Add signoz-integration-collector@<deployment-project-id>.iam.gserviceaccount.com with the role Cloud Run Invoker (roles/run.invoker).
  2. Allow token creation: Go to IAM & Admin > Service Accounts and click the signoz-integration-collector account. Open Principals with access and click Grant access. Add the Pub/Sub service agent service-<deployment-project-number>@gcp-sa-pubsub.iam.gserviceaccount.com with the role Service Account Token Creator (roles/iam.serviceAccountTokenCreator). Find your project number under IAM & Admin > Settings.

Step 5: Create the push subscription

The push subscription sends each message on the topic to the Collector.

  1. Go to Pub/Sub > Subscriptions > Create subscription.
  2. Subscription ID: signoz-integration_logs_push-signoz-integration-collector.
  3. Select a Cloud Pub/Sub topic: projects/<deployment-project-id>/topics/signoz-integration_logs_push.
  4. Delivery type: Push.
  5. Endpoint URL: <collector-service-url>/ (keep the trailing slash).
  6. Turn on Enable authentication and select the signoz-integration-collector service account.
  7. Under Retry policy, choose Retry after exponential backoff delay.
  8. Click Create.

Verify these values:

  • <collector-service-url>: The Collector URL from step 2.

If the Collector is down for a short time (for example, during a redeploy), Pub/Sub keeps the messages and tries again. Messages stay in the subscription for up to 7 days.

Step 6: Create a log sink in each monitored project

A log sink picks logs with a filter and sends them to a destination. Create one sink in each project in Projects to Monitor. Every sink sends to the topic in your deployment project.

Choose the sink filter

Each service page has the filter to use, in Step 4: Send logs:

A project has one SigNoz sink, so to send logs from more than one service, wrap each filter in parentheses and join them with OR:

(<filter-for-service-a>) OR (<filter-for-service-b>)

To write your own filter, see the Logging query language.

Create the sink

Repeat this for each monitored project, including the deployment project if you monitor it.

  1. Select the monitored project (<monitored-project-id>) in the project picker.
  2. Go to Logging > Log Router > Create sink.
  3. Sink name: signoz-integration_logs.
  4. Sink destination: choose Cloud Pub/Sub topic.
    • If this is the deployment project, select signoz-integration_logs_push.
    • For any other project, the list only shows topics in the current project. Click Enter topic manually and enter projects/<deployment-project-id>/topics/signoz-integration_logs_push.
  5. Build inclusion filter: paste your sink filter.
  6. Click Create sink.

Verify these values:

  • <monitored-project-id>: One of your Projects to Monitor.
  • <deployment-project-id>: Your Deployment Project ID. The topic path always uses it, no matter which project the sink is in.
  • <sink-filter>: The filter you chose above. Keep the single quotes around it, since the filters contain double quotes.

Step 7: Allow each sink to publish to the topic

Each sink gets its own service account, called the writer identity. Give it the Pub/Sub Publisher role on the topic. Without this, the sink can't send any logs. Repeat for every sink.

  1. In the project that owns the sink, open Logging > Log Router. Click the sink and copy its Writer identity (it looks like serviceAccount:service-123...@gcp-sa-logging.iam.gserviceaccount.com).
  2. In your deployment project, go to Pub/Sub > Topics. Select the checkbox next to signoz-integration_logs_push (don't open the topic). In the info panel, open Permissions and click Add principal.
  3. Paste the writer identity without the serviceAccount: prefix. Choose the role Pub/Sub Publisher (roles/pubsub.publisher) and save.

Step 8: Avoid paying twice for logs

Every project already sends all its logs to the built-in _Default sink, which stores them in Cloud Logging. Your new sink sends a second copy to SigNoz. To stop paying for both, add an exclusion filter to _Default that matches your SigNoz sink filter.

The exclusion only stops Cloud Logging from storing these logs. Your SigNoz sink still receives them.

  1. In the monitored project, go to Logging > Log Router.
  2. Find the _Default sink, open its menu, and click Edit sink.
  3. Under Choose logs to filter out of sink, click Add exclusion.
  4. Name it signoz-integration and paste the same filter you used in step 6.
  5. Click Update sink.

Validate

  1. In SigNoz, go to Integrations > Google Cloud Platform, select a service, and turn on Log Collection.
  2. Do something in the monitored service that writes a log, or wait a few minutes.
  3. In SigNoz, open Logs and filter by gcp.resource_type or gcp.project. GCP labels show up as attributes such as gcp.label.<label-key>.

Troubleshooting

The Collector fails to start after adding logs. If the logs say address already in use, the health_check extension is still on port 8080. Move it to port 13133 as shown in step 1. If the logs say the receiver or extension is unknown, your image is older than 0.163.1. Redeploy with a newer tag.

The subscription shows push errors. In Pub/Sub > Subscriptions, open signoz-integration_logs_push-signoz-integration-collector and check Unacked message count and the push error metrics. 401 or 403 errors mean the grants in step 4 are missing. 404 or connection errors mean the endpoint URL in step 5 is wrong.

The topic receives nothing. Check that the sink's writer identity has Pub/Sub Publisher on the topic (step 7). Then open Logs Explorer in the monitored project, paste your sink filter, and confirm it matches real logs.

The Collector receives requests but logs don't show in SigNoz. Check the Cloud Run logs for googlecloudpubsubpush or otlphttp errors. Confirm the ingestion key and region in the exporter.

Next steps

Get Help

If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack. If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.

Is this page helpful

Last updated—October 19, 2026

Edit on GitHub