Activate and scrape operational metrics
You can enable metrics to monitor your services running in MK.IO.
The metrics you can scrape from your MK.IO can be used to monitor workflow services, including:
- Live events (input & output bitrate monitoring)
- Streaming endpoints (error rate, bitrate & latency)
- On-demand encode jobs (count of successful & unsuccessful completed jobs)
Metrics are enabled per subscription. Once enabled, you will have access to metrics for all services within your subscription.
Metrics publishing is a chargeable service and is not enabled by default. Please refer to MK.IO Pricing for detailed information.
Enable metrics on your MK.IO subscription
To enable metrics on your MK.IO subscription:
-
Log in to MK.IO and select a subscription.
-
From the left-hand side menu, navigate to Usage and Metrics.
-
Enable the metrics using the switch at the top right of the page.
Once metrics are activated, MK.IO will provide you with a URL, a Username and a Password. This information can be used by your monitoring infrastructure to scrape the metrics from MK.IO.
Alternatively, metrics can be enabled using API. Please refer to API documentation for instructions.
Scrape metrics into Grafana Cloud
Once metrics are enabled in MK.IO, you can obtain a real-time stream of metrics by scraping the “federate” endpoint returned in the enable API call. Metrics are updated every 30s.
To scrape metrics into your Grafana Cloud account:
- Create a Grafana Cloud account: If you do not already have an account, you can create a free one on grafana.com. The free plan allows up to 10,000 metric series forever. As a reference, a single streaming endpoint in MK.IO will typically use less than 500 series.
- Set up a Metrics Endpoint integration in Grafana Cloud:
- Follow the Metrics Endpoint documentation in Grafana Cloud.
- Scrape Job URL should be set to the following:
https://<URL returned by MK.IO
- Authentication: Use Basic Auth, setting the Username and Password to those returned by MK.IO.
- Scrape Interval: Typically, set this to 1 minute to balance cost in Grafana cloud with timely data visibility.
- Import the dashboard or explore metrics: Import this dashboard into your Grafana Cloud account, or simply use the Explore tab to investigate metrics. All MK.IO metrics begin with
mk\_
.
Metrics and labels
Each service in MK.IO provides different sets of metrics and labels.
The "Labels" column shows labels specific to each metric. Additionally, there are labels that are common to all customer metrics: region, project_name, project_id.
The following table lists the existing metrics and associated labels:
Services Exposing | metric | Description | Type | Labels |
---|---|---|---|---|
Subscription | mk_up | Always present and equal to 1 when metrics are enabled | Gauge | |
StreamingEndpoint | mk_jitp_up | Equal to 1 if a streaming endpoint is started | Gauge | resource_name, endpoint_type, cdn_enabled |
StreamingEndpoint | mk_jitp_bitrate | Current bitrate from a streaming endpoint (bits/s) | Gauge | sc_status, content_type, resource_name |
StreamingEndpoint | mk_jitp_request_rate | Current request rate from a streaming endpoint (reqs/s) | Gauge | sc_status, content_type, resource_name |
StreamingEndpoint | mk_jitp_latency_bucket_rate | Histogram providing response times for requests | Histogram rate | sc_status, content_type, resource_name, le |
LiveEventPassThru, LiveEventEncode | mk_live_up | Equal to 1 if a live event is running | Gauge | resource_name |
LiveEventPassThru, LiveEventEncode | mk_live_input_bitrate_bps | Bitrate arriving via rtmp (“type”=“ RTMP”, stream) or SRT (“type”=SRT, “mode” =“Caller | Listener”) | Gauge | resource_name, type, stream, mode |
LiveEventPassThru, LiveEventEncode | mk_live_output_storage_bitrate_bps | The bitrate actually written to storage. Also includes the response code from the storage write request: 201, 404, etc | Gauge | resource_name, sc_status |
Jobs (VideoProcessing, etc) | mk_jobs_completed_total | Total number of completed jobs, including error code if success==false. For VideoProcessing jobs, “type”=“encoding” | Counter | success, type, error |
Updated 2 months ago