Metricbeat azure module - Simultaneously fetch multi-dimensional metric values

I'm trying to fetch Cosmos DB metrics from azure using metricbeat's azure module. An example:

- module: azure
  metricsets:
  - monitor
  enabled: true
  period: 30s
  client_id: '<client_id>'
  client_secret: '<client_secret>'
  tenant_id: '<tenant_id>>'
  subscription_id: '<subscription_id>'
#  refresh_list_interval: 60s
  resources:
   - resource_id: '/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.DocumentDB/databaseAccounts/<DB_instance_name>'
     metrics:
       - name: ['TotalRequests']
         namespace: 'Microsoft.DocumentDB/databaseAccounts'
         dimensions:
         - name: "StatusCode"
           value: "*"

At the time of request, the above metricbeat config seems to fetch the TotalRequests of a randomly selected StatusCode ONLY, whilst I'm looking to fetch the count of the TotalRequests for all StatusCodes.

An example of the documents in the index would look something like the below (irrelevant data is removed from the below):

"@timestamp" : "2021-08-02T07:31:00.000Z"
"azure": {
  "dimensions" : {
      "status_code" : "449"
  },
  "metrics" : {
      "total_requests" : {
          "count" : 294
      }
  }
}

"@timestamp" : "2021-08-02T07:32:00.000Z"
"azure": {
  "dimensions" : {
    "status_code" : "201"
  },
  "metrics" : {
      "total_requests" : {
          "count" : 1497
      }
  }
}

"@timestamp" : "2021-08-02T07:33:00.000Z"
"azure": {
  "dimensions" : {
    "status_code" : "200"
  },
  "metrics" : {
      "total_requests" : {
          "count" : 16734
      }
  }
}

Whilst I'm looking to achieve something on the following lines:

"@timestamp" : "2021-08-02T07:33:00.000Z"
"azure": {
  status_code" : [
      {
          "name": "449",
          "total_requests": {
              "count": 294
          }
      },
      {
          "name": "201",
          "total_requests": {
              "count": 1794
          }
      },
          {
          "name": "200",
          "total_requests": {
              "count": 16734
          }
      }
  ]
}

Can anyone shed some light on fetching all azure metric dimensions simultaneously?

Thanks in advance

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.