Skip to main content

Google Cloud Platform Metrics

Project description

# Google Cloud Monitoring API: Command-Line Tool

## Overview

You need to be authenticated to run this tool as described in

Today it only supports interactive authentication, i.e.:

$ gcloud auth login

We will soon add support of service account tokents.

## Usage

$ gcpmetrics --help

usage: [-h] --project_id ID [--list_resources] [--list_metrics]
[--query] [--since_dawn] [--metric_id ID] [--days INT]
[--hours INT] [--minutes INT] [--resource_filter S]
[--metric_filter S] [--alignment A] [--reduce R]
[--reduce_grouping R] [--iloc00]

optional arguments:
-h, --help show this help message and exit
--project_id ID Project ID.
--list_resources List monitored resource descriptors and exit.
--list_metrics List available metric descriptors and exit.
--query Run the time series query.
--since_dawn Calculate delta since the dawn of time.
--metric_id ID Metric ID as defined by Google Monitoring API..
--days INT Days from now to calculate the query start date.
--hours INT Hours from now to calculate the query start date.
--minutes INT Minutes from now to calculate the query start date.
--resource_filter S Filter of resources in the var:val[,var:val] format.
--metric_filter S Filter of metrics in the var:val[,var:val] format.
--alignment A Alignment of data ALIGN_NONE, ALIGN_SUM. etc.
--reduce R Reduce of data REDUCE_NONE, REDUCE_SUM, etc.
--reduce_grouping R Reduce grouping in the var1[,var2] format.
--iloc00 Print value from the table index [0:0] only.

## Examples

$ gcpmetrics --project_id odin-ap --list_resources

$ gcpmetrics --project_id odin-ap --list_descriptors

$ gcpmetrics --project_id odin-ap --query --since_dawn --metric_id --resource_filter="module_id:service" --metric_filter="response_code_greaterequal:500,response_code_less:600" --align ALIGN_SUM --reduce REDUCE_SUM

$ gcpmetrics --project_id odin-ap --query --since_dawn --metric_id --resource_filter="module_id:service" --metric_filter="response_code_greaterequal:500,response_code_less:600" --align ALIGN_SUM --reduce REDUCE_SUM --iloc00


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gcpmetrics, version 1.0.15
Filename, size File type Python version Upload date Hashes
Filename, size gcpmetrics-1.0.15.tar.gz (6.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page