Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Working Group Two Maintainers authored and gi-wg2 committed Mar 1, 2024
1 parent b38b5d0 commit a9f6321
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 348 deletions.
39 changes: 22 additions & 17 deletions docs/metrics-how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,42 @@ sourceExamples:
# Accessing Metrics

## Overview
The platform exposes metrics that can help operators getting some operational insight. This data is exposed using the [OpenMetrics text format](https://openmetrics.io/).

This text format is the same as exposed by Prometheus. In addition to being supported by Prometheus, many other systems
has OpenMetrics integrations such as
[Datadog](https://docs.datadoghq.com/integrations/openmetrics/)
and [New Relic](https://docs.newrelic.com/docs/integrations/prometheus-integrations).
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](https://openmetrics.io/), and can be scraped by Prometheus or
other systems that support this format.

The HTTP endpoint we provide will give you the current state of all of your metrics. We do not provide a query API.
These metrics are aimed for providing operational insight, and would not be suitable for billing purposes.

Please reach out to clarify what metrics you would need access to.

## Credentials
This API is only supported by operator tokens. Operator tokens are now deprecated, and should only be used for this API.

This API requires the `metrics.read` scope.

**Base path: `https://api.wgtwo.com/metrics/v1`**
To use this API, you would need to have a OAuth 2.0 client and be granted the `metrics.read` scope.

See: [Get client access token](https://docs.wgtwo.com/guide/oauth2/get-client-access-token.html)

## Get metrics, curl

```shell script
curl -s -u ${CLIENT_ID}:${CLIENT_SECRET} https://api.wgtwo.com/metrics/v1
curl -s --oauth2-bearer $ACCESS_TOKEN https://api.wgtwo.com/metrics/v1
```

## Get metrics, Prometheus

The below 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](https://prometheus.io/docs/prometheus/latest/configuration/configuration/)

<source-example
:src="$sourceExamplesMap['examples/config/operator/metrics/prometheus.yml']"
/>
:src="$sourceExamplesMap['examples/config/operator/metrics/prometheus.yml']"
/>

### Example: Run with Docker

> See: [prometheus.io › Using Docker](https://prometheus.io/docs/prometheus/latest/installation/#using-docker)
If you run the below commands, you should have Prometheus running successfully.
Expand All @@ -55,13 +56,17 @@ If you run the below commands, you should have Prometheus running successfully.
docker run -p 9090:9090 -v prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
```

### Grafana
> See: [grafana.com › Using Prometheus in Grafana](https://grafana.com/docs/grafana/latest/features/datasources/prometheus/)
## Grafana

Many of our customers use Grafana to visualize their metrics.

As our metric API does not expose a query API, it cannot be used by Grafana directly.
However, Grafana has built-in support for Prometheus.
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](https://grafana.com/products/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.

## Links

* [openmetrics.io](https://openmetrics.io/)
* [prometheus.io](https://prometheus.io/)[Exposition Formats](https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format)
10 changes: 0 additions & 10 deletions docs/voicemail-api-reference.md

This file was deleted.

69 changes: 0 additions & 69 deletions docs/voicemail-how-to.md

This file was deleted.

15 changes: 10 additions & 5 deletions examples/config/operator/metrics/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ global:
evaluation_interval: 30s

scrape_configs:
- job_name: wgtwo
- job_name: cisco

metrics_path: /metrics/v1

scheme: https
basic_auth:
username: "CLIENT_ID"
password: "CLIENT_SECRET"
oauth2:
client_id: "CLIENT_ID"
client_secret: "CLIENT_SECRET"
scopes:
- metrics.read
token_url: "https://id.wgtwo.com/oauth2/token"

static_configs:
- targets:
- "api.wgtwo.com:443"
- "api.wgtwo.com:443" # Dublin
- "api.sakura.wgtwo.com:443" # Tokyo
- "api.oak.wgtwo.com:443" # Oregon
7 changes: 0 additions & 7 deletions examples/grpcurl/thirdpartydev/voicemail/delete-voicemail.sh

This file was deleted.

7 changes: 0 additions & 7 deletions examples/grpcurl/thirdpartydev/voicemail/list-voicemail.sh

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions examples/grpcurl/thirdpartydev/voicemail/play-voicemail.sh

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion examples/kotlin/thirdpartydev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</parent>

<modules>
<module>voicemail</module>
<module>mms</module>
<module>sms</module>
</modules>
Expand Down
37 changes: 0 additions & 37 deletions examples/kotlin/thirdpartydev/voicemail/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit a9f6321

Please sign in to comment.