Google Cloud Platform stackdriver metricset

edit

Google Cloud Platform stackdriver metricset

edit

This 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.

Stackdriver 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 stackdriver 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
  • metric_types: Required, a list of metric type strings. Each call of the ListTimeSeries API can return any number of time series from a single metric type. Metric type is to used for identifying a specific time series.
  • 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 set to be ALIGN_NONE. Google Cloud also supports ALIGN_DELTA, ALIGN_RATE, ALIGN_MIN, ALIGN_MAX, ALIGN_MEAN, ALIGN_COUNT, ALIGN_SUM and etc. Please see Aggregation Aligner for the full list of aligners.

Example Configuration

edit
  • stackdriver metricset is enabled to collect metrics from all zones under europe-west1-c region in elastic-observability project. 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. With period specified as 300s in the config below, Metricbeat will collect compute metrics from googlecloud every 5-minute with given aggregation aligner applied for each metric type.

    - module: googlecloud
      metricsets:
        - stackdriver
      zone: "europe-west1-c"
      project_id: elastic-observability
      credentials_file_path: "your JSON credentials file path"
      exclude_labels: false
      period: 300s
      stackdriver:
        service: compute
        metrics:
          - aligner: ALIGN_MEAN
            metric_types:
              - "compute.googleapis.com/instance/cpu/usage_time"
              - "compute.googleapis.com/instance/cpu/utilization"
          - aligner: ALIGN_SUM
            metric_types:
              - "compute.googleapis.com/instance/uptime"
  • stackdriver metricset is enabled to collect metrics from all zones under europe-west1-c region in elastic-observability project. 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. With period specified as 60s in the config below, Metricbeat will collect compute metrics from googlecloud every minute with no aggregation. This case, the aligners specified in the configuration will be ignored.

    - module: googlecloud
      metricsets:
        - stackdriver
      zone: "europe-west1-c"
      project_id: elastic-observability
      credentials_file_path: "your JSON credentials file path"
      exclude_labels: false
      period: 60s
      stackdriver:
        service: compute
        metrics:
          - aligner: ALIGN_MEAN
            metric_types:
              - "compute.googleapis.com/instance/cpu/usage_time"
              - "compute.googleapis.com/instance/cpu/utilization"
          - aligner: ALIGN_SUM
            metric_types:
              - "compute.googleapis.com/instance/uptime"

Fields

edit

For 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"
        },
        "instance": {
            "id": "2917397443238883901",
            "name": "gke-observability-8--observability-8--bc1afd95-fv5w"
        },
        "machine": {
            "type": "n1-standard-4"
        },
        "provider": "googlecloud"
    },
    "cloud.availability_zone": "europe-west1-c",
    "event": {
        "dataset": "googlecloud.stackdriver",
        "duration": 115000,
        "module": "googlecloud"
    },
    "googlecloud": {
        "labels": {
            "user": {
                "goog-gke-node": ""
            }
        },
        "stackdriver": {
            "instance": {
                "uptime": 60
            }
        }
    },
    "metricset": {
        "name": "stackdriver",
        "period": 10000
    },
    "service": {
        "type": "googlecloud"
    }
}