Adds a metric definition to a product.
const url = 'https://example.com/api/v1/provision/admin/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metrics';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"metricName":"example","name":"example","description":"example","metricType":"CumulativeCounter","unit":"example","category":"example","numberFormat":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/provision/admin/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metrics \ --header 'Content-Type: application/json' \ --data '{ "metricName": "example", "name": "example", "description": "example", "metricType": "CumulativeCounter", "unit": "example", "category": "example", "numberFormat": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Product id.
Request Bodyrequired
Section titled “Request Bodyrequired”Metric payload.
Admin request to define a metric on a product.
object
How reported usage values are interpreted and aggregated by the monitoring pipeline.
Admin request to define a metric on a product.
object
How reported usage values are interpreted and aggregated by the monitoring pipeline.
Admin request to define a metric on a product.
object
How reported usage values are interpreted and aggregated by the monitoring pipeline.
Responses
Section titled “Responses”OK
A lightweight metric definition on a product: the machine name clients report usage under, plus display metadata (name, unit, category, number format).
object
Machine identifier clients report usage under (as opposed to the display string ProductMetricDto.Name).
How reported usage values are interpreted and aggregated by the monitoring pipeline.
Display format hint, e.g. "0" or "0.0".
A lightweight metric definition on a product: the machine name clients report usage under, plus display metadata (name, unit, category, number format).
object
Machine identifier clients report usage under (as opposed to the display string ProductMetricDto.Name).
How reported usage values are interpreted and aggregated by the monitoring pipeline.
Display format hint, e.g. "0" or "0.0".
Example
{ "metricType": "CumulativeCounter"}A lightweight metric definition on a product: the machine name clients report usage under, plus display metadata (name, unit, category, number format).
object
Machine identifier clients report usage under (as opposed to the display string ProductMetricDto.Name).
How reported usage values are interpreted and aggregated by the monitoring pipeline.
Display format hint, e.g. "0" or "0.0".
Example
{ "metricType": "CumulativeCounter"}Bad Request
object
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}