Register client usage metrics
POST /api/frontend/client/metrics
Registers usage metrics. Stores information about how many times each flag was evaluated to enabled and disabled within a time frame. If provided, this operation will also store data on how many times each feature flag's variants were displayed to the end user. If the Frontend API is disabled 404 is returned.
Request
- application/json
Body
required
clientMetricsSchema
- appName string required
The name of the application that is evaluating toggles
- instanceId string
A (somewhat) unique identifier for the application
- environment string
Which environment the application is running in
bucket objectrequired
Holds all metrics gathered over a window of time. Typically 1 hour wide
start objectrequired
The start of the time window these metrics are valid for. The window is usually 1 hour wide
oneOf- MOD1
- MOD2
string date-timeAn RFC-3339-compliant timestamp.
integerstop objectrequired
The end 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.
integertoggles objectrequired
an object containing feature names with yes/no plus variant usage
property name* object
yes numberHow many times the toggle evaluated to true
no integerHow many times the toggle evaluated to false
variants object
An object describing how many times each variant was returned. Variant names are used as properties, and the number of times they were exposed is the corresponding value (i.e.
{ [variantName]: number }
).property name* integer
- 200
- 204
- 400
- 401
- 404
This response has no body.
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 []."
}
Authorization information is missing or invalid. Provide a valid API token as the authorization
header, e.g. authorization:*.*.my-admin-token
.
- 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": "AuthenticationRequired",
"message": "You must log in to use Unleash. Your request had no authorization header, so we could not authorize you. Try logging in at /auth/simple/login."
}
The requested resource was not found.
- 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": "NotFoundError",
"message": "Could not find the addon with ID \"12345\"."
}