Send metrics in bulk
POST<your-unleash-url>/api/client/metrics/bulk
This operation accepts batched metrics from any client. Metrics will be inserted into Unleash's metrics storage
Request
- application/json
Bodyrequired
bulkMetricsSchema
applications object[]required
metrics object[]required
Responses
- 202
- 400
- 413
- 415
This response has no body.
The request data does not match what we expect.
- application/json
- Schema
- Example (auto)
Schema
id string
The ID of the error instance
Example:
9c40958a-daac-400e-98fb-3bb438567008
name string
The name of the error kind
Example:
ValidationError
message string
A description of what went wrong.
Example:
The request payload you provided doesn't conform to the schema. The .parameters property should be object. You sent [].
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "ValidationError",
"message": "The request payload you provided doesn't conform to the schema. The .parameters property should be object. You sent []."
}
The request body is larger than what we accept. By default we only accept bodies of 100kB or less
- application/json
- Schema
- Example (auto)
Schema
id string
The ID of the error instance
Example:
9c40958a-daac-400e-98fb-3bb438567008
name string
The name of the error kind
Example:
ContentTooLarge
message string
A description of what went wrong.
Example:
You provided more data than we can handle. Unleash accepts at most X MB.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "ContentTooLarge",
"message": "You provided more data than we can handle. Unleash accepts at most X MB."
}
The operation does not support request payloads of the provided type. Please ensure that you're using one of the listed payload types and that you have specified the right content type in the "content-type" header.
- application/json
- Schema
- Example (auto)
Schema
id string
The ID of the error instance
Example:
9c40958a-daac-400e-98fb-3bb438567008
name string
The name of the error kind
Example:
ContentTypeerror
message string
A description of what went wrong.
Example:
We do not accept the content-type you provided (application/xml). Try using one of the content-types we do accept instead (application/json) and make sure the body is in the corresponding format.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "ContentTypeerror",
"message": "We do not accept the content-type you provided (application/xml). Try using one of the content-types we do accept instead (application/json) and make sure the body is in the corresponding format."
}
Authorization: Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
-d '{
"applications": [
{
"connectVia": [
{
"appName": "unleash-edge",
"instanceId": "edge-pod-bghzv5"
}
],
"appName": "Ingress load balancer",
"environment": "development",
"instanceId": "application-name-dacb1234",
"interval": 10,
"started": "2023-07-27T11:23:44Z",
"strategies": [
"standard",
"gradualRollout"
],
"sdkVersion": "unleash-client-java:8.0.0"
}
],
"metrics": [
{
"featureName": "my.special.feature",
"appName": "accounting",
"environment": "development",
"timestamp": "2023-07-27T11:23:44Z",
"yes": 974,
"no": 50,
"variants": {
"variantA": 15,
"variantB": 25,
"variantC": 5
}
}
]
}'
ResponseClear