Client

Register client usage 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.

post/api/client/metrics

Request body

appNamestring required

The name of the application that is evaluating toggles

instanceIdstring

A (somewhat) unique identifier for the application

environmentstring

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

sdkVersionstring

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

platformNamestring

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

platformVersionstring

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.

yggdrasilVersionstring

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

specVersionstring

The version of the Unleash client specification the client supports

Example request

{
  "appName": "insurance-selector",
  "instanceId": "application-name-dacb1234",
  "environment": "development",
  "sdkVersion": "unleash-client-java:7.0.0",
  "platformName": ".NET Core",
  "platformVersion": "3.1",
  "yggdrasilVersion": "1.0.0",
  "specVersion": "3.0.0",
  "bucket": {
    "start": "2023-07-27T11:23:44Z",
    "stop": "2023-07-27T11:23:44Z",
    "toggles": {
      "myCoolToggle": {
        "yes": 25,
        "no": 42,
        "variants": {
          "blue": 6,
          "green": 15,
          "red": 46
        }
      },
      "myOtherToggle": {
        "yes": 0,
        "no": 100
      }
    }
  }
}

Response

This response has no body.

Changes