Skip to main content

Register client usage metrics

POST 

/api/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.

Request

Body

required

clientMetricsSchema

    appName stringrequired

    The name of the application that is evaluating toggles

    Example: insurance-selector
    instanceId string

    A (somewhat) unique identifier for the application

    Example: application-name-dacb1234
    environment stringdeprecated

    Which environment the application is running in. This property was deprecated in v5. This can be determined by the API key calling this endpoint.

    Example: development
    sdkVersion string

    An SDK version identifier. Usually formatted as "unleash-client-:"

    Example: unleash-client-java:7.0.0
    platformName string

    The platform the application is running on. For languages that compile to binaries, this can be omitted

    Example: .NET Core
    platformVersion string

    The version of the platform the application is running on. Languages that compile to binaries, this is expected to be the compiler version used to assemble the binary.

    Example: 3.1
    yggdrasilVersion string

    The semantic version of the Yggdrasil engine used by the client. If the client is using a native engine this can be omitted.

    Example: 1.0.0
    specVersion string

    The version of the Unleash client specification the client supports

    Example: 3.0.0

    bucket

    object

    required

    Holds all metrics gathered over a window of time. Typically 1 hour wide

    start

    object

    required

    The start of the time window these metrics are valid for. The window is usually 1 hour wide

    oneOf

    An RFC-3339-compliant timestamp.

    string

    stop

    object

    required

    The end of the time window these metrics are valid for. The window is 1 hour wide

    oneOf

    An RFC-3339-compliant timestamp.

    string

    toggles

    object

    required

    an object containing feature names with yes/no plus variant usage

    property name*

    object

    yes number

    How many times the toggle evaluated to true

    Example: 974
    no integer

    How many times the toggle evaluated to false

    Example: 50

    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

Responses

This response has no body.

Loading...