Send metrics in bulk
POST /api/client/metrics/bulk
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
A list of applications registered by an Unleash SDK
Array [connectVia object[]
A list of applications this app registration has been registered through. If connected directly to Unleash, this is an empty list. This can be used in later visualizations to tell how many levels of proxy or Edge instances our SDKs have connected through
Array [appName string requiredinstanceId string required]appName string requiredThe name of the application that is evaluating toggles
environment string requiredWhich environment the application is running in
instanceId string requiredA (somewhat) unique identifier for the application
interval numberHow often (in seconds) the application refreshes its features
started object
The application started at
oneOf- MOD1
- MOD2
string date-timeAn RFC-3339-compliant timestamp.
integerstrategies string[]Enabled strategies in the application
sdkVersion stringThe version the sdk is running. Typically
: ]metrics object[]required
a list of client usage metrics registered by downstream providers. (Typically Unleash Edge)
Array [featureName string requiredName of the feature checked by the SDK
appName string requiredThe name of the application the SDK is being used in
environment string requiredWhich environment the SDK is being used in
timestamp object
The start of the time window these metrics are valid for. The window is 1 hour wide
oneOf- MOD1
- MOD2
string date-timeAn RFC-3339-compliant timestamp.
integeryes integerHow many times the toggle evaluated to true
no integerHow many times the toggle evaluated to false
variants object
How many times each variant was returned
property name* integer]
- 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."
}