1.1
1.1
post /v1/metrics/custom
Description
Create Custom Metrics. The request body of this API can receive data in either camelCase or snake_case.
State ACTIVE (CURRENT)
| Version | Supported Until |
|---|---|
| 1.1 | - |
Parameters
| Type | Name | Description | Schema | Default |
|---|---|---|---|---|
| body | body required | MetricCustomRequest |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 202 | Accepted | None |
| 400 | Bad Request | None |
| 401 | Unauthorized | None |
| 403 | Forbidden | None |
Example HTTP request
Request path
/v1/metrics/custom
Request header
"Scp-Accesskey = 2sd2gg=2agbdSD26svcD",
"Scp-Signature = fsfsdf235f9U35sdgf35Xsf/qgsdgsdg326=sfsdr23rsef=",
"Scp-Timestamp = 1605290625682",
"Scp-ClientType = Openapi",
"Accept-Language = en-US",
"Scp-Api-Version = servicewatch 1.1"
Request body
{
"resource_metrics": [
{
"resource": {
"attributes": [
{
"key": "",
"value": {
"array_value": "",
"bool_value": "",
"byte_value": "",
"double_value": "",
"int_value": "",
"kvlist_value": "",
"string_value": ""
}
}
]
},
"scope_metrics": [
{
"metrics": [
{
"description": "The total number of bytes read successfully.",
"gauge": {
"data_points": [
{
"as_double": 0.75,
"as_int": 10,
"attributes": [
{
"key": "",
"value": {
"array_value": "",
"bool_value": "",
"byte_value": "",
"double_value": "",
"int_value": "",
"kvlist_value": "",
"string_value": ""
}
}
],
"start_time_unix_nano": "1753776789854000000",
"time_unix_nano": "1753776789854000000"
}
]
},
"name": "node_disk_read_bytes_total",
"sum": {
"aggregation_temporality": "2",
"data_points": [
{
"as_double": 0.75,
"as_int": 10,
"attributes": [
{
"key": "",
"value": {
"array_value": "",
"bool_value": "",
"byte_value": "",
"double_value": "",
"int_value": "",
"kvlist_value": "",
"string_value": ""
}
}
],
"start_time_unix_nano": "1753776789854000000",
"time_unix_nano": "1753776789854000000"
}
],
"is_monotonic": true
},
"unit": "Bytes"
}
],
"scope": {
"name": "ServiceWatch-Agent",
"version": "1.0.0"
}
}
]
}
]
}