Monitor Media Services

When you have critical applications and business processes relying on Azure resources, you want to monitor those resources for their availability, performance, and operation. This article describes the monitoring data generated by Media Services and how you can use the features of Azure Monitor to analyze and alert on this data.

Azure Monitor

Media Services creates monitoring data using Azure Monitor, which is a full stack monitoring service in Azure that provides a complete set of features to monitor your Azure resources in addition to resources in other clouds and on-premises.

Start with reading the article Monitoring Azure resources with Azure Monitor, which describes the following concepts:

  • What is Azure Monitor?
  • Costs associated with monitoring
  • Monitoring data collected in Azure
  • Configuring data collection
  • Standard tools in Azure for analyzing and alerting on monitoring data

Media Services monitoring data

Media Services collects the same kinds of monitoring data as other Azure resources that are described in Monitoring data from Azure resources.

All data collected by Azure Monitor fits into one of two fundamental types: metrics and logs. With these two types you can:

  • Visualize and analyze the metrics data using Metrics Explorer.
  • Monitor Media Services diagnostic logs and create alerts and notifications for them.
  • You can send or stream logs to:
    • Azure Storage
    • Azure Event Hubs
    • Log Analytics
    • Use third-party services

Collection and routing

Platform metrics and the Activity log are collected and stored automatically, but can be routed to other locations by using a diagnostic setting.

Resource Logs are not collected and stored until you create a diagnostic setting and route them to one or more locations.

See the article Create diagnostic setting to collect platform logs and metrics in Azure for the detailed process of creating a diagnostic setting.

Media Services metrics

Media Services metrics are collected at regular intervals whether or not the value changes.

Metric types

Metrics available for Media Services are:

Note

At the time of this writing, you cannot create diagnostic settings for Live event metrics or streaming endpoint metrics in the Azure portal.

Metric dimensions

For more information on what metric dimensions are, see Multi-dimensional metrics.

Media services has the following metric dimensions. They are self-explantory based on the metrics they support.

  • OutputFormat
  • HttpStatusCode
  • ErrorCode
  • TrackName

Analyzing metrics

You can analyze metrics for Media Services along with metrics from other Azure services using Metrics Explorer. See Getting started with Azure Metrics Explorer for details on using this tool.

Media Services logs

Activity logs

The Activity log is a platform log that provides insight into subscription-level events. You can view it independently or route it to Azure Monitor Logs, where you can do much more complex queries using Log Analytics.

Resource logs

Resource logs provide rich and frequent data about the operation of an Azure resource. For more information, see How to collect and consume log data from your Azure resources.

Media Services supports the following resource logs: Microsoft.Media/mediaservices

Media Services diagnostic logs

Some things that you can examine with diagnostic logs are:

  • The number of licenses delivered by DRM type
  • The number of licenses delivered by policy
  • The latency on key delivery requests
  • HTTP Status codes by DRM key type (PlayReady, WideVine, FairPlay, Clear) or policy type
  • The number of unauthorized license requests from clients

Schemas

For detailed description of the top-level diagnostic logs schema, see Supported services, schemas, and categories for Azure Diagnostic Logs.

Key delivery

These properties are specific to the key delivery log schema.

Name Description
keyId The ID of the requested key.
keyType Could be one of the following values: "Clear" (no encryption), "FairPlay", "PlayReady", or "Widevine".
policyName The Azure Resource Manager name of the policy.
tokenType The token type.
statusMessage The status message.

Example

Properties of the key delivery requests schema.

{
    "time": "2019-01-11T17:59:10.4908614Z",
    "resourceId": "/SUBSCRIPTIONS/00000000-0000-0000-0000-0000000000/RESOURCEGROUPS/SBKEY/PROVIDERS/MICROSOFT.MEDIA/MEDIASERVICES/SBDNSTEST",
    "operationName": "MICROSOFT.MEDIA/MEDIASERVICES/CONTENTKEYS/READ",
    "operationVersion": "1.0",
    "category": "KeyDeliveryRequests",
    "resultType": "Succeeded",
    "resultSignature": "OK",
    "durationMs": 315,
    "identity": {
        "authorization": {
            "issuer": "http://testacs",
            "audience": "urn:test"
        },
        "claims": {
            "urn:microsoft:azure:mediaservices:contentkeyidentifier": "3321e646-78d0-4896-84ec-c7b98eddfca5",
            "iss": "http://testacs",
            "aud": "urn:test",
            "exp": "1547233138"
        }
    },
    "level": "Informational",
    "location": "uswestcentral",
    "properties": {
        "requestId": "b0243468-d8e5-4edf-a48b-d408e1661050",
        "keyType": "Clear",
        "keyId": "3321e646-78d0-4896-84ec-c7b98eddfca5",
        "policyName": "56a70229-82d0-4174-82bc-e9d3b14e5dbf",
        "tokenType": "JWT",
        "statusMessage": "OK"
    }
}
 {
    "time": "2019-01-11T17:59:33.4676382Z",
    "resourceId": "/SUBSCRIPTIONS/00000000-0000-0000-0000-0000000000/RESOURCEGROUPS/SBKEY/PROVIDERS/MICROSOFT.MEDIA/MEDIASERVICES/SBDNSTEST",
    "operationName": "MICROSOFT.MEDIA/MEDIASERVICES/CONTENTKEYS/READ",
    "operationVersion": "1.0",
    "category": "KeyDeliveryRequests",
    "resultType": "Failed",
    "resultSignature": "Unauthorized",
    "durationMs": 2,
    "level": "Error",
    "location": "uswestcentral",
    "properties": {
        "requestId": "875af030-b77c-416b-b7e1-58f23ebec182",
        "keyType": "Clear",
        "keyId": "3321e646-78d0-4896-84ec-c7b98eddfca5",
        "policyName": "56a70229-82d0-4174-82bc-e9d3b14e5dbf",
        "tokenType": "None",
        "statusMessage": "No token present in authorization header or URL."
    }
}

Analyzing logs

Data in Azure Monitor Logs is stored in tables where each table has its own set of unique properties.

All resource logs in Azure Monitor have the same fields followed by service-specific fields. The common schema is outlined in Azure Monitor resource log schema.

Alerts

Azure Monitor alerts proactively notify you when important conditions are found in your monitoring data. They allow you to identify and address issues in your system. You can set alerts on metrics, [logs](/azure/azure-monitor/alerts/git status alerts-unified-log), and the activity log.

How-tos

Monitor Media Services metrics