steampipe plugin install gcp

Table: gcp_logging_metric - Query Google Cloud Platform Logging Metrics using SQL

Google Cloud Platform's Logging Metrics is a feature that allows users to create user-defined metrics based on logs. These metrics can be used for monitoring and automating responses to specific log entries. It provides a way to track the count of log entries that match specific filters.

Table Usage Guide

The gcp_logging_metric table provides insights into user-defined metrics in Google Cloud Platform's Logging. As a system administrator or DevOps engineer, explore metric-specific details through this table, including metric descriptors, metric type, and associated metadata. Utilize it to monitor and automate responses to specific log entries, helping to ensure system stability and performance.

Examples

Filter info of each metric

Explore which logging metrics are currently set up in your Google Cloud Platform (GCP) environment. This can help you understand what kind of data is being collected and monitored, which is critical for effective system management and troubleshooting.

select
name as metric_name,
description,
filter
from
gcp_logging_metric;
select
name as metric_name,
description,
filter
from
gcp_logging_metric;

Bucket configuration details of the logging metrics

Explore the configuration of logging metrics in Google Cloud Platform, focusing on specific parameters such as growth factor, scale, offset, and width. This can be useful in understanding the structure and distribution of data within your logging metrics, aiding in efficient data management and analysis.

select
name,
exponential_buckets_options_growth_factor,
exponential_buckets_options_num_finite_buckets,
exponential_buckets_options_scale,
linear_buckets_options_num_finite_buckets,
linear_buckets_options_offset,
linear_buckets_options_width,
explicit_buckets_options_bounds
from
gcp_logging_metric;
select
name,
exponential_buckets_options_growth_factor,
exponential_buckets_options_num_finite_buckets,
exponential_buckets_options_scale,
linear_buckets_options_num_finite_buckets,
linear_buckets_options_offset,
linear_buckets_options_width,
explicit_buckets_options_bounds
from
gcp_logging_metric;

Control examples

Schema for gcp_logging_metric

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
create_timetimestamp with time zoneThe creation timestamp of the metric.
descriptiontextA user-specified, human-readable description of the metric.
explicit_buckets_options_boundsjsonbSpecifies the bounds, used to create a histogram for the distribution.
exponential_buckets_options_growth_factordouble precisionSpecifies the growth factor of a bucket with exponential sequence, used to create a histogram for the distribution. Value must be greater than 1.
exponential_buckets_options_num_finite_bucketsbigintSpecifies the finite buckets, used to create a histogram for the distribution. Value must be greater than 0.
exponential_buckets_options_scaledouble precisionSpecifies the scale. Value must be greater than 0.
filtertextAn advanced logs filter used to match log entries.
label_extractorsjsonbA map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value.
linear_buckets_options_num_finite_bucketsbigintSpecifies the number of finite buckets of linear sequence. Value must be greater than 0.
linear_buckets_options_offsetdouble precisionSpecifies the lower bound of the first bucket.
linear_buckets_options_widthdouble precisionSpecifies the width, used to create a histogram for the distribution.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
metric_descriptor_display_nametextA concise name for the metric, which can be displayed in user interfaces.
metric_descriptor_labelsjsonbThe set of labels that can be used to instance of this metric type.
metric_descriptor_metric_kindtextThe kind of the metric. Possible values are 'METRIC_KIND_UNSPECIFIED', 'GAUGE', 'DELTA', 'CUMULATIVE'.
metric_descriptor_typetextThe metric type, including its DNS name in prefix.
metric_descriptor_unittextThe units in which the metric value is reported.
metric_descriptor_value_typetextThe value type of the measurement.
nametext=The client-assigned metric identifier.
projecttext=, !=, ~~, ~~*, !~~, !~~*The GCP Project in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
titletextTitle of the resource.
update_timetimestamp with time zoneThe last update timestamp of the metric.
value_extractortextA value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry.
versiontextThe API version that created or updated this metric.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- gcp

You can pass the configuration to the command with the --config argument:

steampipe_export_gcp --config '<your_config>' gcp_logging_metric