Google Cloud Platform metrics metricset
editGoogle Cloud Platform metrics metricset
editThis functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
Operations monitoring provides visibility into the performance, uptime, and overall health
of cloud-powered applications. It collects metrics, events, and metadata from
different services from Google Cloud. This metricset is to collect monitoring
metrics from Google Cloud using ListTimeSeries API. The full list of metric
types that Google Cloud monitoring supports can be found in
Google Cloud Metrics.
Each monitoring metric from Google Cloud has a sample period and/or ingest delay. Sample period is the time interval between consecutive data points for metrics that are written periodically. Ingest delay represents the time for data points older than this value are guaranteed to be available to read. Sample period and ingest delay are obtained from making ListMetricDescriptors API call.
Metricset config and parameters
edit-
aligner: A single string with which aggregation operation need to be applied
onto time series data for ListTimeSeries API. If it’s not given, default aligner
is
ALIGN_NONE. Google Cloud also supportsALIGN_DELTA,ALIGN_RATE,ALIGN_MIN,ALIGN_MAX,ALIGN_MEAN,ALIGN_COUNT,ALIGN_SUMetc. Please see Aggregation Aligner for the full list of aligners. -
metric_types: Required, a list of metric type strings, or a list of metric
type prefixes. For example,
instance/cpuis the prefix for metric typeinstance/cpu/usage_time,instance/cpu/utilizationetc Each call of theListTimeSeriesAPI can return any number of time series from a single metric type. Metric type is to used for identifying a specific time series. -
service: Required, the name of the service for related metrics. This should
be a valid Google Cloud service name. Service names may be viewed from the
corresponding page from GCP Metrics list documentation.
The
servicefield is used to compute the GCP Metric prefix, unlessservice_metric_prefixis set. -
service_metric_prefix: A string containing the full Metric prefix as
specified in the GCP documentation.
All metrics from GCP Monitoring API require a prefix. When
service_metric_prefixis empty, the prefix default to a value computed using theservicevalue:<service>.googleapis.com/. This default works for any services under "Google Cloud metrics", but does not work for other services (kubernetesaka GKE for example). This option allow to override the default and specify an arbitrary metric prefix.
Example Configuration
edit-
metricsmetricset is enabled to collect metrics from all zones undereurope-west1-cregion inelastic-observabilityproject. Two sets of metrics are specified: first one is to collect CPU usage time and utilization with aggregation aligner ALIGN_MEAN; second one is to collect uptime with aggregation aligner ALIGN_SUM. These metric types all have 240 seconds ingest delay time and 60 seconds sample period. Withperiodspecified as300sin the config below, Metricbeat will collect compute metrics from Google Cloud every 5-minute with given aggregation aligner applied for each metric type.- module: googlecloud metricsets: - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" exclude_labels: false period: 300s metrics: - aligner: ALIGN_MEAN service: compute metric_types: - "instance/cpu/usage_time" - "instance/cpu/utilization" - aligner: ALIGN_SUM service: compute metric_types: - "instance/uptime" -
metricsmetricset is enabled to collect metrics from all zones undereurope-west1-cregion inelastic-observabilityproject. Two sets of metrics are specified: first one is to collect CPU usage time and utilization with aggregation aligner ALIGN_MEAN; second one is to collect uptime with aggregation aligner ALIGN_SUM. These metric types all have 240 seconds ingest delay time and 60 seconds sample period. Withperiodspecified as60sin the config below, Metricbeat will collect compute metrics from Google Cloud every minute with no aggregation. This case, the aligners specified in the configuration will be ignored.- module: googlecloud metricsets: - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" exclude_labels: false period: 60s metrics: - aligner: ALIGN_MEAN service: compute metric_types: - "instance/cpu/usage_time" - "instance/cpu/utilization" - aligner: ALIGN_SUM service: compute metric_types: - "instance/uptime" -
metricsmetricset is enabled to collect metrics from all zones undereurope-west1-cregion inelastic-observabilityproject. One set of metrics will be collected: metric types that starts withinstance/cpuundercomputeservice with aligner ALIGN_NONE. These metric types all have 240 seconds ingest delay time and 60 seconds sample period. Withperiodspecified as1min the config below, Metricbeat will collect compute metrics from Google Cloud every minute with no aggregation. The metric types incomputeservice withinstance/cpuprefix are:instance/cpu/reserved_cores,instance/cpu/scheduler_wait_time,instance/cpu/usage_time, andinstance/cpu/utilization.- module: googlecloud metricsets: - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" exclude_labels: false period: 1m metrics: - aligner: ALIGN_NONE service: compute metric_types: - "instance/cpu" -
metricsmetricset is enabled to collect metrics from all zones undereurope-west1-cregion inelastic-observabilityproject. One set of metrics will be collected: core usage time for containers in GCP GKE. Note that the is required to useservice_metric_prefixto override the default metric prefix, as for GKE metrics the required prefix iskubernetes.io/- module: googlecloud metricsets: - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" exclude_labels: false period: 1m metrics: - service: gke service_metric_prefix: kubernetes.io/ metric_types: - "container/cpu/core_usage_time"
Fields
editFor a description of each field in the metricset, see the exported fields section.
Here is an example document generated by this metricset:
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"cloud": {
"account": {
"id": "elastic-observability",
"name": "elastic-observability"
},
"instance": {
"id": "4049989596327614796",
"name": "nchaulet-loadtest-horde-master"
},
"machine": {
"type": "n1-standard-8"
},
"provider": "gcp"
},
"cloud.availability_zone": "us-central1-a",
"cloud.region": "us-central1",
"event": {
"dataset": "gcp.metrics",
"duration": 115000,
"module": "gcp"
},
"gcp": {
"labels": {},
"metrics": {
"instance": {
"uptime_total": {
"value": 791820
}
}
}
},
"host": {
"id": "4049989596327614796",
"name": "nchaulet-loadtest-horde-master"
},
"metricset": {
"name": "metrics",
"period": 10000
},
"service": {
"type": "gcp"
}
}