google-cloud-platformmetricbeat

Metricbeat GCP module cloudsql not working


I'm trying to get Cloud SQL metrics with this module config without success:

- module: gcp
  metricsets:
    - metrics
  region: "us-"
  project_id: "my-project"
  credentials_file_path: "/usr/share/metricbeat/config/pkey.json"
  period: 300s
  metrics:
    - aligner: ALIGN_NONE
      service: cloudsql
      metric_types:
        - "database/cpu/utilization"

"message": "Could not read time series value: cloudsql.googleapis.com/database/cpu/utilization: rpc error: code = InvalidArgument desc = The supplied filter does not specify a valid combination of metric and monitored resource descriptors. The query will not return any time series." },

cloudsql.googleapis.com/database/cpu/utilization is the same value I see if I go to the Metrics explorer so I'm not sure what's going on.


Solution

  • The solution was to remove the region property as Cloud SQL API doesnt expose that and the filter that metricbeat build breaks.

    I opened an issue : https://github.com/elastic/beats/issues/32906

    Working configuration:

    - module: gcp
      metricsets:
        - metrics
      project_id: "my-project"
      credentials_file_path: "/usr/share/metricbeat/config/pkey.json"
      period: 300s
      metrics:
        - service: cloudsql
          metric_types:
            - "database/cpu/utilization"