You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
17
17
18
18
<Macroid="requirements" />
19
19
20
20
- A Scaleway account logged into the [console](https://console.scaleway.com)
21
21
-[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
23
23
- A running [Prometheus](https://prometheus.io) instance
24
24
25
-
<Messagetype="info">
25
+
<Messagetype="note">
26
26
The `/federate` endpoint will not be billed during the beta phase. After the beta, the endpoint will incur additional costs.
27
27
</Message>
28
28
@@ -32,7 +32,7 @@ Since you have full control over your Prometheus instance, you can also use fede
32
32
## Configure your Prometheus
33
33
34
34
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.
36
36
37
37
```yaml
38
38
global:
@@ -45,7 +45,7 @@ scrape_configs:
45
45
http_headers:
46
46
X-Token:
47
47
values:
48
-
- '$SCW_READ_TOKEN'
48
+
- '$SCW_COCKPIT_TOKEN'
49
49
params:
50
50
'match[]':
51
51
- '{__name__="instance_.*"}'
@@ -56,21 +56,21 @@ scrape_configs:
56
56
```
57
57
58
58
<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`.
60
60
</Message>
61
61
62
62
Modify the different `match[]` parameters according to the metrics you want to retrieve. In this example, you will federate:
63
63
- All metrics with a name that starts with `instance_`
64
64
- All metrics with the label `region` with the value `fr-par`
65
65
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.
68
68
69
69
## Run your Prometheus instance
70
70
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.
72
72
73
-
1. Create a `docker-compose.yml` file with:
73
+
Create a `docker-compose.yml` file and paste the following template into it:
74
74
```yaml
75
75
services:
76
76
prometheus:
@@ -83,19 +83,21 @@ Once you have configured your `prometheus.yml` file, you can use docker-compose
83
83
command:
84
84
- '--config.file=/etc/prometheus/prometheus.yml'
85
85
```
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.
88
88
89
89
## Monitor your federation volumes
90
90
91
91
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.
92
92
This metric indicates the total volume of exported samples through the federation endpoint over a 5 minutes interval.
93
93
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.
98
100
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.
0 commit comments