Get Premium Zones Server Stats

The Premium Zones Server Stats API provides statistics on Encoder, Broker, and Manifest servers as well as S3 that are in Premium Zones. This API only provides valid data when an account owner has Premium Zones enabled on their account.

This API gets metrics for the previous 60 seconds, meaning that it should be polled every minute.

This API endpoint returns the following data:​

  • 4xx Errors from S3​
  • 5xx Errors from S3​
  • All S3 Requests (Delete, Get, Put, and Post)​
  • S3 Put Requests​
  • Max CPU Usage​
  • Mean CPU Usage​
  • P90 CPU Usage (90th Percentile)​
  • Maximum Memory Usage​
  • Mean Memory Usage​
  • P90 Memory Usage (90th Percentile)

Manifest servers are referred to as “Content” servers in the returned data.

Base URL

Use the following base URL to perform an HTTP GET:

https://services.uplynk.com/api/v4/monitoring/premium-zone/server-stats

Request Parameters

This API has no input parameters.

Sample Request

The code below (Python 3) shows how to retrieve Premium Zone server and S3 statistics.

This code imports names from the api_auth module for V4 APIs (see below).

import json
import requests
from api_auth import APICredentials, APIParams
  
class PZ_ServerStats:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        self._get_server_stats()
  
    def _get_server_stats(self):
    
        url = "{}{}".format(self.host, "/api/v4/monitoring/premium-zone/server-stats")

        headers = {'Content-Type': 'application/json'}
  
        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({}), headers=headers
        )
  
        print(json.dumps(response.json(), indent=4))
  
PZ_ServerStats().run()

Response Schema

The response returns Premium Zones data.

FieldData TypeDescription
@idStringThe request URL with query parameters included.
itemsArrayList of server statistics (schema below).
total_itemsIntegerThe total number of server statistics returned.

Server Statistics Item Schema

FieldData TypeDescription
metricStringThis is the metric being measured. For S3, these metrics are 4xxErrors, 5xxErrors, AllRequests, DeleteRequests, GetRequests, PostRequests, and PutRequests. For servers, these metrics are cpu_max, cpu_mean, cpu_p90, memory_max, memory_mean, and memory_p90. AllRequests may be returned as All Requests.
serviceStringThis is an S3 service or for servers it is broker, encoder, content, or empty (internally used).
latest_valueStringThe value of the metric being measured.
latest_updated_atStringThe timestamp when the metric was measured.

Sample Response

{
    "@id": "/api/v4/monitoring/premium-zone/server-stats",
    "@type": "Collection",
    "items": [
        {
            "metric": "4xxErrors",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 142.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "4xxErrors",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 143.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "4xxErrors",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 6.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "5xxErrors",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 1.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "5xxErrors",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 0.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "5xxErrors",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 0.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "AllRequests",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 1.0,
            "latest_updated_at": 1743430920000
        },
        {
            "metric": "AllRequests",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 1190829.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "AllRequests",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 222907.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "AllRequests",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 2830.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "DeleteRequests",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 454.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "DeleteRequests",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 290.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "DeleteRequests",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 0.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "GetRequests",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 138780.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "GetRequests",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 436.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "GetRequests",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 2.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "PostRequests",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 0.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "PostRequests",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 0.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "PostRequests",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 0.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "PutRequests",
            "service": "s3_uplynk-xxxx-use1",
            "latest_value": 1051594.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "PutRequests",
            "service": "s3_uplynk-xxxx-use2",
            "latest_value": 222175.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "PutRequests",
            "service": "s3_uplynk-xxxx-usw2",
            "latest_value": 2828.0,
            "latest_updated_at": 1767127140000
        },
        {
            "metric": "cpu_max",
            "service": "broker",
            "latest_value": 20.50962456318344,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_max",
            "service": "content",
            "latest_value": 28.71095096192421,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_max",
            "service": "empty",
            "latest_value": 0.6171003113409644,
            "latest_updated_at": 1763281980000
        },
        {
            "metric": "cpu_max",
            "service": "encoder",
            "latest_value": 95.38382831220834,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_mean",
            "service": "broker",
            "latest_value": 4.546323969458562,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_mean",
            "service": "content",
            "latest_value": 20.48599935401177,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_mean",
            "service": "empty",
            "latest_value": 0.6171003113409644,
            "latest_updated_at": 1763281470000
        },
        {
            "metric": "cpu_mean",
            "service": "encoder",
            "latest_value": 26.358017629731258,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_p90",
            "service": "broker",
            "latest_value": 11.929233811697893,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_p90",
            "service": "content",
            "latest_value": 26.529224128953672,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "cpu_p90",
            "service": "empty",
            "latest_value": 0.6171003113409644,
            "latest_updated_at": 1763281440000
        },
        {
            "metric": "cpu_p90",
            "service": "encoder",
            "latest_value": 67.88548057197188,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_max",
            "service": "broker",
            "latest_value": 27.540992824906326,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_max",
            "service": "content",
            "latest_value": 67.01328825335928,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_max",
            "service": "empty",
            "latest_value": 3.985944104711396,
            "latest_updated_at": 1763282010000
        },
        {
            "metric": "memory_max",
            "service": "encoder",
            "latest_value": 61.46881805455696,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_mean",
            "service": "broker",
            "latest_value": 19.608923391741016,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_mean",
            "service": "content",
            "latest_value": 53.98290312819665,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_mean",
            "service": "empty",
            "latest_value": 3.985944104711396,
            "latest_updated_at": 1763282430000
        },
        {
            "metric": "memory_mean",
            "service": "encoder",
            "latest_value": 23.447304790657615,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_p90",
            "service": "broker",
            "latest_value": 24.125183786188693,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_p90",
            "service": "content",
            "latest_value": 65.69982630753213,
            "latest_updated_at": 1767127800000
        },
        {
            "metric": "memory_p90",
            "service": "empty",
            "latest_value": 3.985944104711396,
            "latest_updated_at": 1763282460000
        },
        {
            "metric": "memory_p90",
            "service": "encoder",
            "latest_value": 31.961344565661072,
            "latest_updated_at": 1767127800000
        }
    ],
    "total_items": 46
}