How to view ultra low latency stream metrics by using the Wowza Streaming Cloud REST API

Learn how to use the REST API to get health metrics for an ultra low latency stream target in the Wowza Streaming Cloud™ service. Health metrics include details about the source connection and throughput details that can help you understand how a stream was received and processed.

Note: The Wowza ultra low latency REST API is in private preview release. For information see Ultra Low Latency with Wowza.

Contents


Ultra low latency stream target health metrics parameters
View current health metrics for an active Wowza ultra low latency stream target
View historic health metrics for a Wowza ultra low latency stream target

Ultra low latency stream target health metrics parameters


Parameter Data Type Description
from string

For historic metrics only. The start of the range of time you want to view. Express the value by using the ISO 8601 standard of YYYY-MM-DDTHH:MM:SSZ where HH is a 24-hour clock in UTC.

interval string

For historic metrics only. The length of time for a block of metrics. Valid values are second, minute, hour, day, or month or an integer with the unit s, m, h, or d. The default is 10m (10 minutes).

stream_target_id string Required. The unique alphanumeric string that identifies the ultra low latency stream target.
to string

For historic metrics only. The end of the range of time you want to view. Express the value by using the ISO 8601 standard of YYYY-MM-DDTHH:MM:SSZ where HH is a 24-hour clock in UTC.

Notes:
  • Although there are no absolute limits on the length of the time range or the interval you can query, the larger the range and the smaller the interval, the longer the query will take to process.
  • Metrics are returned for WebSocket streams only.

View current health metrics for an active Wowza ultra low latency stream target


To view current stream health metrics for an active ultra low latency stream target, call the endpoint:

https://api.cloud.wowza.com/api/[version]/stream_targets/[stream_target_id]/metrics/current

The request returns a snaphot of current metrics for the stream target at the time of the request.

Example request and response

Notes:

  • For [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
  • For [version], substitute the version number of the API that you're using. For the current version, use v1.

View the stream health metrics of an active ultra low latency stream target:

curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/stream_targets/1234abcd/metrics/current"

Metrics for the active stream target (1234abcd in this example) are returned in the response, which should look something like this:

{
    "stream_target": {
        "id": "1234abcd",
        "metrics": {
           "average_total_connections": 45,
           "minimum_total_connections": 40,
           "maximum_total_connections": 50,
           "new_connections": 5,
           "dropped_connections": 0,
           "average_bytes_in": 276637.33,
           "created_at": "2017-09-01T10:27:52.000Z"
        }
    }
}

View historic health metrics for a Wowza ultra low latency stream target


To view historic stream health metrics for an ultra low latency stream target that's running or stopped, call the endpoint:

https://api.cloud.wowza.com/api/[version]/stream_targets/[stream_target_id]/metrics/historic

Example requests and responses

View stream health metrics for an ultra low latency stream target with 10-second intervals:

curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/stream_targets/1234abcd/metrics/historic

The command returns an array of metrics for the duration of the stream in 10-second blocks of time. It should look something like this:

{
    "stream_target": {
        "id": "1234abcd",
        "interval": "10m",
        "metrics": [
            {
                "average_total_connections": 1,
                "minimum_total_connections": 1,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 353915.45,
                "created_at": "2017-08-09T18:50:00.000Z"
            },
            {
                "average_total_connections": 0.68,
                "minimum_total_connections": 0,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 384116.51,
                "created_at": "2017-08-09T19:00:00.000Z"
            },
            {
                "average_total_connections": 0.85,
                "minimum_total_connections": 0,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 386634.64,
                "created_at": "2017-08-09T19:10:00.000Z"
            },
            {
                "average_total_connections": 0.49,
                "minimum_total_connections": 0,
                "maximum_total_connections": 2,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 395559.25,
                "created_at": "2017-08-09T19:20:00.000Z"
            }
        ]
    },
    "limits": {
        "from": null,
        "to": null,
        "interval": "10m"
    }
}

View stream health metrics for the ultra low latency stream target 1234abcd for a one day (September 10, 2017) at hourly intervals:

curl -X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/stream_targets/1234abcd/metrics/historic?from=2017-09-10T00:00:00Z&to=2017-09-10T23:59:59Z&interval=hour"

The command returns an array of metrics that should look something like this:

{
    "stream_target": {
        "id": "1234abcd",
        "interval": "1h",
        "metrics": [
            {
                "average_total_connections": 1,
                "minimum_total_connections": 1,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 353915.45,
                "created_at": "2017-09-10T00:00:00.000Z"
            },
            {
                "average_total_connections": 1,
                "minimum_total_connections": 1,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 385568.57,
                "created_at": "2017-09-10T01:00:00.000Z"
            },
            {
                "average_total_connections": 1,
                "minimum_total_connections": 1,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 395494.73,
                "created_at": "2017-09-10T00:02:00.000Z"
            },
            {...},
            {
                "average_total_connections": 0.59,
                "minimum_total_connections": 0,
                "maximum_total_connections": 1,
                "new_connections": 0,
                "dropped_connections": 0,
                "average_bytes_in": 395437,
                "created_at": "2017-09-10T23:23:00.000Z"
            }
        ]
    },
    "limits": {
        "from": "2017-09-10T00:00:00.000Z",
        "to": "2017-09-10T23:59:59.000Z",
        "interval": "1h"
    }
}

If you're having problems or want to discuss this article, post in our forum.