Setting up OpenMetrics for Service Monitoring
Note
This feature is currently in Beta and the format is subject to change.
This topic describes an example configuration for setting up the Prometheus / OpenMetrics endpoint in Megaport’s API.
OpenMetrics is a specification for representing and exchanging metrics data in a standardized format, primarily influenced by the Prometheus exposition format.
With the OpenMetrics endpoint integrated into Megaport’s API, this allows you to expose existing service monitoring information.
In the Prometheus configuration example below, the scrape interval is set to one minute, but the network is only polled every five minutes. You will need to consider this in your PromQL/Grafana dashboarding.
Before you begin, obtain a valid access token. For more information, see Creating an API Key.
Megaport API details
- API: /v1/openmetrics
- Authentication: API key/OAuth2
Example Prometheus Configuration
global:
scrape_interval: 5m
scrape_configs:
- job_name: megaport
static_configs:
- targets: ["api.megaport.com"]
scheme: https
metrics_path: /v1/openmetrics
oauth2:
token_url: https://auth-m2m.megaport.com/oauth2/token
client_id: <api key>
client_secret: <api secret>
Metrics
The endpoint currently exports these metrics for all services.
Port
# HELP megaport_service_input_errors_total The total number of input errors.
# TYPE megaport_service_input_errors_total counter
# HELP megaport_service_optical_receive_power_dbm Optical receive power level in dBm.
# TYPE megaport_service_optical_receive_power_dbm gauge
# HELP megaport_service_optical_transmit_power_dbm Optical transmit power level in dBm.
# TYPE megaport_service_optical_transmit_power_dbm gauge
# HELP megaport_service_output_errors_total The total number of output errors.
# TYPE megaport_service_output_errors_total counter
# HELP megaport_service_receive_bytes_total The total number of bytes received.
# TYPE megaport_service_receive_bytes_total counter
# HELP megaport_service_receive_packets_total The total number of packets received.
# TYPE megaport_service_receive_packets_total counter
# HELP megaport_service_transmit_bytes_total The total number of bytes transmitted.
# TYPE megaport_service_transmit_bytes_total counter
# HELP megaport_service_transmit_packets_total The total number of packets transmitted.
# TYPE megaport_service_transmit_packets_total counter
# HELP megaport_service_up Operational status of the service.
# TYPE megaport_service_up gauge
VXC
# HELP megaport_service_receive_bytes_total The total number of bytes received.
# TYPE megaport_service_receive_bytes_total counter
# HELP megaport_service_receive_packets_total The total number of packets received.
# TYPE megaport_service_receive_packets_total counter
# HELP megaport_service_transmit_bytes_total The total number of bytes transmitted.
# TYPE megaport_service_transmit_bytes_total counter
# HELP megaport_service_transmit_packets_total The total number of packets transmitted.
# TYPE megaport_service_transmit_packets_total counter
# HELP megaport_service_up Operational status of the service.
# TYPE megaport_service_up gauge
MCR
# HELP megaport_service_receive_bytes_total The total number of bytes received.
# TYPE megaport_service_receive_bytes_total counter
# HELP megaport_service_receive_packets_total The total number of packets received.
# TYPE megaport_service_receive_packets_total counter
# HELP megaport_service_transmit_bytes_total The total number of bytes transmitted.
# TYPE megaport_service_transmit_bytes_total counter
# HELP megaport_service_transmit_packets_total The total number of packets transmitted.
# TYPE megaport_service_transmit_packets_total counter
# HELP megaport_service_up Operational status of the service.
# TYPE megaport_service_up gauge
MVE
# HELP megaport_service_receive_bytes_total The total number of bytes received.
# TYPE megaport_service_receive_bytes_total counter
# HELP megaport_service_receive_packets_total The total number of packets received.
# TYPE megaport_service_receive_packets_total counter
# HELP megaport_service_transmit_bytes_total The total number of bytes transmitted.
# TYPE megaport_service_transmit_bytes_total counter
# HELP megaport_service_transmit_packets_total The total number of packets transmitted.
# TYPE megaport_service_transmit_packets_total counter
# HELP megaport_service_up Operational status of the service.
# TYPE megaport_service_up gauge