How to Access Metrics
Overview
You may query our HTTP endpoint to get the current state of all the metrics that has been made available for you. The metrics are exposed in the OpenMetrics text format, and can be scraped by Prometheus or other systems that support this format.
These metrics are intended to provide operational insight, and are not suitable for billing purposes.
Please reach out to clarify what metrics you would need access to.
Required Scope
metrics.read
Code, Curl
curl -s --oauth2-bearer $ACCESS_TOKEN https://sandbox.api.shamrock.wgtwo.com/metrics/v1
Code, Prometheus
global:
scrape_interval: 30s
evaluation_interval: 30s
scrape_configs:
- job_name: cisco
metrics_path: /metrics/v1
scheme: https
oauth2:
client_id: "CLIENT_ID"
client_secret: "CLIENT_SECRET"
scopes:
- metrics.read
token_url: "https://id.wgtwo.com/oauth2/token"
static_configs:
- targets:
- "api.shamrock.wgtwo.com:443" # Dublin
- "api.sakura.wgtwo.com:443" # Tokyo
- "api.oak.wgtwo.com:443" # Oregon
This Prometheus config will scrape the metric endpoint every 30 seconds, fetching all available time series. Note that the configuration will contain secrets.
You may replace client_secret
with client_secret_file
which should contain the path to a file containing the secret.
See: prometheus.io › Configuration
Example: Run with Docker
If you run the following command, you should have Prometheus running successfully.
# Store sample configuration to prometheus.yaml, including actual credentials
docker run -p 9090:9090 -v prometheus.yaml:/etc/prometheus/prometheus.yaml prom/prometheus
Grafana
Many of our customers use Grafana to visualize their metrics.
In order to use Grafana with our metrics, you would need to have a Prometheus server running and scraping the metrics.
An alternative to running this yourself would be to use Grafana Cloud. In that case you would typically run Grafana Agent, which is a Prometheus-compatible agent that can scrape metrics and send them to Grafana Cloud.