Skip to content

Commit 833dd7a

Browse files
authored
docs(review): review and test doc
1 parent 0193d04 commit 833dd7a

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

pages/cockpit/how-to/federate-scaleway-metrics.mdx

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ meta:
55
content:
66
h1: How to federate Scaleway metrics with your own Prometheus
77
paragraph: Learn how to retrieve your Scaleway metrics with federation and reuse them within your own Prometheus with this step-by-step guide.
8-
tags: federation cockpit metrics observability monitoring prometheus
8+
tags: federation cockpit metrics monitoring prometheus
99
categories:
1010
- observability
1111
dates:
12-
validation: TBD
13-
posted: TBD
12+
validation: 2025-07-04
13+
posted: 2025-07-04
1414
---
1515

16-
In this page, we will show you how to federate your Scaleway metrics using the `/federate` endpoint of your Scaleway datasources with a [Prometheus](https://prometheus.io) configuration.
16+
In this page, we will show you how to federate your Scaleway metrics using the `/federate` endpoint of your Scaleway data sources with a [Prometheus](https://prometheus.io) configuration. Metrics federation cnsists of collecting metrics from multiple sources or systems into a central place so you can visualize everything at once.
1717

1818
<Macro id="requirements" />
1919

2020
- A Scaleway account logged into the [console](https://console.scaleway.com)
2121
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
22-
- [Created](/cockpit/how-to/create-token/) a Cockpit token that have query metrics priviledge in the same region as the metrics data source
22+
- [Created](/cockpit/how-to/create-token/) a Cockpit token with the `query` permission in the same region as the metrics data source
2323
- A running [Prometheus](https://prometheus.io) instance
2424

25-
<Message type="info">
25+
<Message type="note">
2626
The `/federate` endpoint will not be billed during the beta phase. After the beta, the endpoint will incur additional costs.
2727
</Message>
2828

@@ -32,7 +32,7 @@ Since you have full control over your Prometheus instance, you can also use fede
3232
## Configure your Prometheus
3333

3434
Create a `prometheus.yml` file to configure your Prometheus instance, using the example below.
35-
Make sure you replace `$SCW_DATASOURCE_URL` with the URL of your data source. The URL can be found under the "API URL" section in the [Data sources tab](https://console.scaleway.com/cockpit/dataSource) of the Scaleway console. Replace `$SCW_READ_TOKEN` with your Cockpit token with read permissions.
35+
Make sure you replace `$SCW_DATASOURCE_URL` with the URL of your data source. The URL can be found under the **API URL** section of the [Data sources tab](https://console.scaleway.com/cockpit/dataSource) in the Scaleway console. Replace `$SCW_COCKPIT_TOKEN` with your Cockpit token with the `query` permission.
3636

3737
```yaml
3838
global:
@@ -45,7 +45,7 @@ scrape_configs:
4545
http_headers:
4646
X-Token:
4747
values:
48-
- '$SCW_READ_TOKEN'
48+
- '$SCW_COCKPIT_TOKEN'
4949
params:
5050
'match[]':
5151
- '{__name__="instance_.*"}'
@@ -56,21 +56,21 @@ scrape_configs:
5656
```
5757
5858
<Message type="important">
59-
Do not include `https://` in the `SCW_DATASOURCE_URL`.
59+
Remove `https://` from the `SCW_DATASOURCE_URL`. Your URL should look like the following: `bc380fc1-9a64-4d51-a560-39c8754207de.metrics.cockpit.fr-par.scw.cloud`.
6060
</Message>
6161

6262
Modify the different `match[]` parameters according to the metrics you want to retrieve. In this example, you will federate:
6363
- All metrics with a name that starts with `instance_`
6464
- All metrics with the label `region` with the value `fr-par`
6565

66-
You can also set `honor_labels` to `false` if you prefer to not override the different labels that your Prometheus could set that conflict with Scaleway metrics label.
67-
For example, with `honor_labels` set to `false` the Scaleway label `job` will be relabelled as `exported_job` to avoid collision.
66+
You can also set `honor_labels` to `false` if you do not want to override the different labels set by your Prometheus that conflict with Scaleway metrics label.
67+
For example, with `honor_labels` set to `false`, the Scaleway label `job` will be relabelled as `exported_job` to avoid collision.
6868

6969
## Run your Prometheus instance
7070

71-
Once you have configured your `prometheus.yml` file, you can use docker-compose to run your Prometheus instance with the configuration and start federating Scaleway metrics.
71+
Once you have configured your `prometheus.yml` file, you can use docker-compose to run your Prometheus instance with your configuration and start federating Scaleway metrics.
7272

73-
1. Create a `docker-compose.yml` file with:
73+
Create a `docker-compose.yml` file and paste the following template into it:
7474
```yaml
7575
services:
7676
prometheus:
@@ -83,19 +83,21 @@ Once you have configured your `prometheus.yml` file, you can use docker-compose
8383
command:
8484
- '--config.file=/etc/prometheus/prometheus.yml'
8585
```
86-
2. Run `docker-compose up -d` to start your Prometheus instance
87-
3. Go to `http://localhost:9090/targets` and you should see your newly created target, federating your Scaleway metrics.
86+
87+
[Access your localhost](http://localhost:9090/targets) to see your newly created target federating your Scaleway metrics.
8888

8989
## Monitor your federation volumes
9090

9191
You can monitor the amount of samples federated with the `/federate` endpoint by looking at the `observability_cockpit_federate_exported_sample_total:increase5m` in your Cockpit.
9292
This metric indicates the total volume of exported samples through the federation endpoint over a 5 minutes interval.
9393

94-
1. Go to the Cockpit page on the Scaleway console
95-
2. Click on `Open dashboards` to open your Grafana
96-
3. Go to the Explore tab on the left panel
97-
4. Search for the `observability_cockpit_federate_exported_sample_total:increase5m` metrics
94+
1. Click **Cockpit** in the **Monitoring** section of the [console](https://console.scaleway.com/) side menu. The **Cockpit** overview page displays.
95+
2. Click **Open dashboards** to access your Cockpit Grafana.
96+
3. Click the **Toggle menu** icon in the top left corner of your screen, then click **Explore**.
97+
4. In the **Metric** drop-down, select the `observability_cockpit_federate_exported_sample_total:increase5m` metrics and if necessary, update the time range in the top right corner of your screen.
98+
99+
Your metrics should display in the graph.
98100

99-
<Message type="info">
100-
You can also federate this metrics to monitor your volume of federated metrics directly in your Prometheus instance.
101-
</Message>
101+
<Message type="note">
102+
You can also federate this metrics data source to monitor your volume of federated metrics directly in your Prometheus instance.
103+
</Message>

0 commit comments

Comments
 (0)