Method: projects.metricDescriptors.create

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric descriptors define custom metrics. The metric descriptor is updated if it already exists, except that metric labels are never removed.

HTTP request

POST https://monitoring.googleapis.com/v3/{name}/metricDescriptors

Path parameters

Parameters
name

string

Required. The project on which to execute the request. The format is: 4 projects/[PROJECT_ID_OR_NUMBER]

Request body

The request body contains an instance of MetricDescriptor.

Response body

If successful, the response body contains a newly created instance of MetricDescriptor.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.