Skip to main content

Send metrics in bulk

POST 

<your-unleash-url>/api/client/metrics/bulk

This operation accepts batched metrics from any client. Metrics will be inserted into Unleash's metrics storage

Request

Bodyrequired

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 stringrequired
    instanceId stringrequired
  • ]
  • appName stringrequired

    The name of the application that is evaluating toggles

    Example: Ingress load balancer
    environment stringrequired

    Which environment the application is running in

    Example: development
    instanceId stringrequired

    A (somewhat) unique identifier for the application

    Example: application-name-dacb1234
    interval number

    How often (in seconds) the application refreshes its features

    Example: 10
    started object

    The application started at

    oneOf
    string

    An RFC-3339-compliant timestamp.

    Example: 2023-07-27T11:23:44Z
    strategies string[]

    Enabled strategies in the application

    Example: ["standard","gradualRollout"]
    sdkVersion string

    The version the sdk is running. Typically :

    Example: unleash-client-java:8.0.0
  • ]
  • metrics object[]required

    a list of client usage metrics registered by downstream providers. (Typically Unleash Edge)

  • Array [
  • featureName stringrequired

    Name of the feature checked by the SDK

    Example: my.special.feature
    appName stringrequired

    The name of the application the SDK is being used in

    Example: accounting
    environment stringrequired

    Which environment the SDK is being used in

    Example: development
    timestamp object

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

    oneOf
    string

    An RFC-3339-compliant timestamp.

    Example: 2023-07-27T11:23:44Z
    yes integer

    How many times the toggle evaluated to true

    Example: 974
    no integer

    How many times the toggle evaluated to false

    Example: 50
    variants object

    How many times each variant was returned

    property name* integer
  • ]

Responses

This response has no body.

Authorization: Authorization

name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
curl -L '<your-unleash-url>/api/client/metrics/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
-d '{
"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
}
}
]
}'
Request Collapse all
Base URL
<your-unleash-url>
Auth
Body required
{
  "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
      }
    }
  ]
}
ResponseClear

Click the Send API Request button above and see the response here!