> ## Documentation Index
> Fetch the complete documentation index at: https://docs.megaport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Telemetry Metric Types

> This help topic describes the Megaport telemetry API endpoints and the metric types they return, including the units and sub-types for each metric.

The Megaport telemetry API returns performance and status metrics for your services. Each request selects a metric through the `type` query parameter, using one of the metric type identifiers described in this topic. The API matches these identifiers case-insensitively.

Each service type has its own telemetry endpoint and its own set of metric types. The endpoints and their parameters are described in [Telemetry API endpoints](#telemetry-api-endpoints), and each metric type is defined in [Metric types](#metric-types).

For the Portal views of the same data, see [Service Telemetry](/monitoring/service-telemetry) and [IX Telemetry](/ix/ix-telemetry).

## Telemetry API endpoints

Retrieve telemetry data by sending a GET request to the endpoint for the service type you are monitoring. Each endpoint accepts a set of metric type values through its `type` query parameter.

Before you begin, obtain a valid access token. For more information, see [Creating an API Key](/api/api-key).

### Request parameters

Each request supports these parameters through its query string or path.

| Parameter  | Required | Description                                                                                                                    |
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| productUid | Yes      | Path parameter. The UID of the service for which to return telemetry.                                                          |
| type       | Yes      | One or more metric type identifiers to return.<br />Repeat the parameter to request more than one metric.                      |
| from / to  | No       | The start and end of the time range, as Unix timestamps in milliseconds. Supply both or neither.                               |
| days       | No       | The number of days of data to return, as an alternative to `from` and `to`.                                                    |
| resolution | No       | The sampling resolution: `5min`, `daily`, or `monthly`.<br />Defaults to `5min`. The `5min` resolution is limited to 180 days. |

### Endpoints by service type

Each endpoint accepts these metric type values.

| Service Type | Endpoint                                               | Metric Types                                                                                                |
| ------------ | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| Port         | GET /v2/product/megaport/\{productUid}/telemetry       | `BITS`, `PACKETS`, `ERRORS`, `OPTICAL`, `OPTICAL_100G`, `SUBSCRIBED_SPEED`, `SERVICE_COUNT`                 |
| VXC          | GET /v2/product/vxc/\{productUid}/telemetry            | `A_BITS`, `B_BITS`, `A_PACKETS`, `B_PACKETS`                                                                |
| MCR          | GET /v2/product/mcr2/\{productUid}/telemetry           | `BITS`, `PACKETS`                                                                                           |
| MVE          | GET /v2/product/mve/\{productUid}/telemetry            | `BITS`, `PACKETS`                                                                                           |
| IX           | GET /v2/product/ix/\{productUid}/telemetry             | `BITS`, `PACKETS`, `ROUTES_IMPORTED`, `ROUTES_FILTERED`, `BM_BYTES`, `BM_PACKETS`, `UU_BYTES`, `UU_PACKETS` |
| NAT Gateway  | GET /v3/products/nat\_gateways/\{productUid}/telemetry | `BITS`, `PACKETS`                                                                                           |

## Metric types

The following metric types are available through the `type` query parameter. Each entry lists the metric type identifier, the unit its values are returned in, and its sub-types. Not every metric type applies to every service type. See [Telemetry API endpoints](#telemetry-api-endpoints) for the metric types each endpoint accepts.

### Traffic

`BITS` - Traffic on the service, reported separately for each direction. The measured value is returned to users in Megabits per second (Mbps) unit.

Sub-types:

* `In`
* `Out`
* `Configured speed (Mbps)` - The configured speed value, returned alongside In and Out

`A_BITS` - Traffic at the A-End of the connection, reported separately for each direction. The measured value is returned to users in Megabits per second (Mbps) unit.

Sub-types:

* `In`
* `Out`
* `Configured speed (Mbps)` - The configured speed value, returned alongside In and Out

`B_BITS` - Traffic at the B-End of the connection, reported separately for each direction. The measured value is returned to users in Megabits per second (Mbps) unit.

Sub-types:

* `In`
* `Out`
* `Configured speed (Mbps)` - The configured speed value, returned alongside In and Out

### Packets

`PACKETS` - Packets on the service, reported separately for each direction. The measured value is returned to users in packets per second (pps) unit.

Sub-types:

* `In`
* `Out`

`A_PACKETS` - Packets at the A-End of the connection, reported separately for each direction. The measured value is returned to users in packets per second (pps) unit.

Sub-types:

* `In`
* `Out`

`B_PACKETS` - Packets at the B-End of the connection, reported separately for each direction. The measured value is returned to users in packets per second (pps) unit.

Sub-types:

* `In`
* `Out`

### Errors

`ERRORS` - Errors on the service, reported separately for each direction. The measured value is returned to users in errors per second unit.

Sub-types:

* `In`
* `Out`

### Optical

`OPTICAL` - Optical signal levels for the service. The measured value is returned to users in decibel milliwatts (dBm) unit.

Sub-types:

* `Tx Power` - Light level transmitted
* `Rx Power` - Light level received

`OPTICAL_100G` - Optical signal levels for a 100 Gbps Port, reported per lane. Useful for measuring signal loss over the connection. The measured value is returned to users in decibel milliwatts (dBm) unit.

Sub-types:

* `Tx Power Lane` - Light level transmitted, reported for each lane
* `Rx Power Lane` - Light level received, reported for each lane

### Speed and service count

`SUBSCRIBED_SPEED` - The subscribed speed of the service. The measured value is returned to users in Megabits per second (Mbps) unit.

Sub-types:

* `Mbps` - The subscribed speed value

`SERVICE_COUNT` - The number of active services connected to the service. The measured value is returned to users as a count of services.

Sub-types:

* `Count` - The number of active services

### Routing

`ROUTES_IMPORTED` - A count of the BGP routes accepted from the IX peer, reported separately for each route server. The measured value is returned to users as a count of BGP routes.

Sub-types:

* `Primary IPv4`
* `Primary IPv6`
* `Secondary IPv4`
* `Secondary IPv6`

`ROUTES_FILTERED` - A count of the imported BGP routes dropped by Megaport route filters, reported separately for each route server. The measured value is returned to users as a count of BGP routes.

Sub-types:

* `Primary IPv4`
* `Primary IPv6`
* `Secondary IPv4`
* `Secondary IPv6`

### Broadcast, multicast, and unknown unicast

`BM_BYTES` - The volume of broadcast and multicast traffic emitted from the IX peer. The measured value is returned to users in Megabits per second (Mbps) unit.

Sub-types:

* `Bytes`

`BM_PACKETS` - The rate of broadcast and multicast packets emitted from the IX peer. The measured value is returned to users in packets per second (pps) unit.

Sub-types:

* `Packets`

`UU_BYTES` - The volume of unknown unicast traffic emitted from the IX peer. The measured value is returned to users in Megabits per second (Mbps) unit.

Sub-types:

* `Bytes`

`UU_PACKETS` - The rate of unknown unicast packets emitted from the IX peer. The measured value is returned to users in packets per second (pps) unit.

Sub-types:

* `Packets`

## Helpful references

* [Creating an API Key](/api/api-key)
* [IX Telemetry](/ix/ix-telemetry)
* [Service Telemetry](/monitoring/service-telemetry)
* [Setting up OpenMetrics for Service Monitoring](/api/monitoring/api-openmetrics)
