---
title: GCP Stack Driver
slug: telemetry-pipeline/gcp-stack-driver
docTags: 
createdAt: 2025-04-21T00:59:44.009Z
---

# GCP Operations Logs Sink

## Overview

The **GCP Operations Logs sink** delivers **log events** to **Google Cloud Operations** (formerly Stackdriver Logging).
&#x20;It integrates worker with Google Cloud’s centralized logging platform, enabling native ingestion into Cloud Logging for analysis, retention, and correlation with other GCP observability signals.

This sink is typically used when:

- workloads run on Google Cloud infrastructure,&#x20;
- logs must be stored and analyzed inside GCP for compliance or operational reasons,&#x20;
- Cloud Logging is used as the primary observability backend.&#x20;

## Supported Input Types

- Logs&#x20;

## Authentication

### Authentication Methods

The sink supports multiple authentication mechanisms. One of the following must be available:

- **Service account credentials file**&#x20;
- **API key**&#x20;
- **Application Default Credentials (ADC)**&#x20;

If no explicit credentials are configured:

- the GOOGLE\_APPLICATION\_CREDENTIALS environment variable is checked,&#x20;
- otherwise, instance-level service accounts are used when running on Google Compute Engine.&#x20;

This allows seamless authentication in managed GCP environments without embedding credentials in configuration.

## Target Scope Configuration

Exactly **one** of the following target scopes must be defined. This determines where logs are published within Google Cloud.

### Project

Publishes logs to a specific **GCP project**.

This is the most common configuration and is recommended for:

- application-level logging,&#x20;
- team-owned workloads,&#x20;
- isolated billing and access control.&#x20;

### Organization

Publishes logs at the **organization level**.

Typically used for:

- centralized logging across multiple projects,&#x20;
- organization-wide compliance and audit pipelines.&#x20;

### Folder

Publishes logs to a specific **GCP folder**.

Useful for:

- grouping related projects,&#x20;
- enforcing logging policies at an intermediate hierarchy level.&#x20;

### Billing Account

Publishes logs associated with a **billing account**.

This mode is generally used for:

- billing-related telemetry,&#x20;
- organization-wide financial observability.&#x20;

## Log Identification

### Log ID (required)

Defines the **logical log stream name** inside Cloud Logging.

Key characteristics:

- Used to group related log entries.&#x20;
- Appears as the log name in the Cloud Logging UI and APIs.&#x20;
- Supports dynamic values to route different event types into separate log streams.&#x20;

## Resource Mapping

### Monitored Resource (required)

Specifies the **GCP monitored resource** associated with log entries.

Examples include:

- Compute Engine instances,&#x20;
- Kubernetes workloads,&#x20;
- managed services.&#x20;

Each resource:

- has a required type,&#x20;
- includes type-specific labels such as instance ID, zone, or cluster name.&#x20;

Correct resource mapping is critical for:

- log-to-metric correlation,&#x20;
- native GCP dashboards,&#x20;
- infrastructure-aware filtering.&#x20;

## Metadata Enrichment

### Labels

Custom **key–value labels** can be attached to log entries.

Labels are used for:

- indexing and filtering,&#x20;
- cost attribution,&#x20;
- environment or tenant tagging.&#x20;

Labels may be:

- statically defined,&#x20;
- dynamically extracted from event fields.&#x20;

### Severity Mapping

Defines how log severity is derived from incoming events.

Behavior:

- a specified event field is mapped to GCP’s severity levels,&#x20;
- numeric or textual severity values are supported,&#x20;
- if unset, logs default to DEFAULT severity.&#x20;

This enables consistent severity handling across heterogeneous log sources.

## Delivery Shaping

### Batch Behavior

Controls how log events are grouped before being sent to GCP.

Batching affects:

- API request rate,&#x20;
- ingestion latency,&#x20;
- quota utilization.&#x20;

Default settings balance throughput and responsiveness for most workloads.

### Buffering Behavior

Defines how logs are buffered locally when delivery is temporarily constrained.

Supported buffering strategies:

- **Memory buffering** for higher performance,&#x20;
- **Disk buffering** for improved durability across restarts.&#x20;

When buffers are full:

- backpressure can be applied upstream,&#x20;
- or newer events can be dropped if continuity is prioritized.&#x20;

## Payload Control

### Encoding Controls

Field-level transformations can be applied prior to ingestion:

- include only selected fields,&#x20;
- exclude noisy or unnecessary fields,&#x20;
- normalize timestamps to supported formats.&#x20;

These controls help:

- reduce ingestion volume,&#x20;
- improve query efficiency,&#x20;
- align logs with Cloud Logging schema expectations.&#x20;

## Network and Transport Controls

### Proxy Support

Supports HTTP and HTTPS proxies with optional exclusion rules.

Used in environments with:

- restricted outbound access,&#x20;
- centralized egress gateways,&#x20;
- regulated network paths.&#x20;

### Request Behavior

Advanced request controls allow fine-tuning delivery behavior:

- adaptive or fixed concurrency,&#x20;
- rate limiting aligned with GCP quotas,&#x20;
- retry strategies with backoff,&#x20;
- request timeouts.&#x20;

These settings are typically adjusted in:

- high-throughput logging environments,&#x20;
- multi-sink deployments,&#x20;
- quota-constrained projects.&#x20;

### TLS Configuration

Supports secure communication using TLS, including:

- custom certificate authorities,&#x20;
- certificate and key configuration,&#x20;
- strict hostname and certificate verification.&#x20;

TLS should always be enabled when logs traverse untrusted networks.
