GCP Cloud Monitoring (formerly Stackdrive) Metrics
Configuration Options
Required Options
project_id(required)
The project ID to which to publish logs. See the Google Cloud Platform project management documentation for more details.
Exactly one of billing_account_id
, folder_id
, organization_id
, or project_id
must be set.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal | ["vector-123456"] |
inputs(required)
A list of upstream source or transform
IDs. Wildcards (*
) are supported.
See configuration for more info.
Type | Syntax | Default | Example |
---|---|---|---|
array | literal | ["my-source-or-transform-id","prefix-*"] |
encoding(required)
Configures the encoding specific sink behavior.
Type | Syntax | Default | Example |
---|---|---|---|
hash | literal | [] |
resource(required)
Options for describing the logging resource.
Type | Syntax | Default | Example |
---|---|---|---|
hash | literal | [{"type":"global","projectId":"vector-123456","instanceId":"Twilight","zone":"us-central1-a"}] |
type(required)
The component type. This is a required field for all components and tells Vector which component to use.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal | ["gcp_stackdriver_metrics"] |
Advanced Options
credentials_path(optional)
The filename for a Google Cloud service account credentials JSON file used to authenticate access to the Stackdriver Logging API. If this is unset, Vector checks the GOOGLE_APPLICATION_CREDENTIALS
environment variable for a filename.
If no filename is named, Vector will attempt to fetch an instance service account for the compute instance the program is running on. If Vector is not running on a GCE instance, you must define a credentials file as above.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal | ["/path/to/credentials.json"] |
default_namespace(optional)
The namespace used if the metric we are going to send to GCP has no namespace.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal | namespace | ["vector-123456"] |
buffer(optional)
Configures the sink specific buffer behavior.
Type | Syntax | Default | Example |
---|---|---|---|
hash | literal | [] |
batch(optional)
Configures the sink batching behavior.
Type | Syntax | Default | Example |
---|---|---|---|
hash | [] |
request(optional)
Configures the sink request behavior.
Type | Syntax | Default | Example |
---|---|---|---|
hash | [] |
tls(optional)
Configures the TLS options for incoming connections.
Type | Syntax | Default | Example |
---|---|---|---|
hash | literal | [] |
proxy(optional)
Configures an HTTP(S) proxy for Vector to use. By default, the globally configured proxy is used.
Type | Syntax | Default | Example |
---|---|---|---|
hash | literal | [] |
How it Works
State
This component is stateless, meaning its behavior is consistent across each input.
GCP Authentication
GCP offers a variety of authentication methods and Vector is concerned with the server to server methods and will find credentials in the following order:
- If the
credentials_path
option is set. - If the
api_key
option is set. - If the
GOOGLE_APPLICATION_CREDENTIALS
envrionment variable is set. - Finally, Vector will check for an instance service account.
If credentials aren't found, Vector's health checks fail and an error is logged.
Partitioning
Vector supports dynamic configuration values through a simple template syntax. If an option supports templating, it will be noted with a badge and you can use event fields to create dynamic values. For example:
[sinks.my-sink]
dynamic_option = "application={{ application_id }}"
In the above example, the application_id
for each event will be
used to partition outgoing data.
Rate limits & adapative concurrency
Transport Layer Security (TLS)
Buffers and batches
This component buffers & batches data as shown in the diagram above. You'll notice that Vector treats these concepts differently, instead of treating them as global concepts, Vector treats them as sink specific concepts. This isolates sinks, ensuring services disruptions are contained and delivery guarantees are honored.
Batches are flushed when 1 of 2 conditions are met:
- The batch age meets or exceeds the configured
timeout_secs
. - The batch size meets or exceeds the configured
max_size
ormax_events
.
Buffers are controlled via the buffer.*
options.
Retry policy
Vector will retry failed requests (status == 429, >= 500, and != 501).
Other responses will not be retried. You can control the number of
retry attempts and backoff rate with the request.retry_attempts
and
request.retry_backoff_secs
options.