Send metrics in bulk
POST <your-unleash-url>/api/client/metrics/bulk
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
This operation accepts batched metrics from any client. Metrics will be inserted into Unleash's metrics storage
Request
- application/json
Body
required
bulkMetricsSchema
applications object[]required
metrics object[]required
- 202
- 400
- 413
- 415
This response has no body.
The request data does not match what we expect.
- application/json
- Schema
- Example (from schema)
Schema
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"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 (from schema)
Schema
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"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 (from schema)
Schema
- id string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"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
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Request
Request
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'
curl -L -X POST '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"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
}
}
]
}'