Method: projects.metricDescriptors.create

Creates a new metric descriptor. User-created metric descriptors define custom metrics.

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:

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.