Skip to content

Commit 301cbe7

Browse files
author
Bibas
committed
Update doc content
- Renamed Scaleway product metrics to Scaleway metrics - Add paragraph on how to monitor federated metrics volume - Add scaleway metrics in example - Add info on honor_labels field in config - Increased scrape_interval in config - Removed useless API key field in pre-requisite
1 parent f9251ef commit 301cbe7

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

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

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
meta:
33
title: How to federate Scaleway metrics with your own Prometheus
4-
description: Learn how to retrieve your Scaleway product metrics with federation and reuse them within your own Prometheus with this step-by-step guide.
4+
description: Learn how to retrieve your Scaleway metrics with federation and reuse them within your own Prometheus with this step-by-step guide.
55
content:
66
h1: How to federate Scaleway metrics with your own Prometheus
7-
paragraph: Learn how to retrieve your Scaleway product metrics with federation and reuse them within your own Prometheus with this step-by-step guide.
7+
paragraph: Learn how to retrieve your Scaleway metrics with federation and reuse them within your own Prometheus with this step-by-step guide.
88
tags: federation cockpit metrics observability monitoring prometheus
99
categories:
1010
- observability
@@ -13,23 +13,21 @@ dates:
1313
posted: TBD
1414
---
1515

16-
In this page, we will show you how to federate your Scaleway product 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 datasources with a [Prometheus](https://prometheus.io) configuration.
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
2222
- [Created](/cockpit/how-to/create-token/) a Cockpit token with read access in the same region as the metrics data source
23-
- [Created](/iam/how-to/create-api-keys/) an API key and retrieved your API secret key
2423
- A running [Prometheus](https://prometheus.io) instance
2524

2625
<Message type="info">
2726
The `/federate` endpoint will not be billed during the beta phase. After the beta, the endpoint will incur additional costs.
2827
</Message>
2928

30-
<Message type="important">
31-
- Federating Scaleway product metrics is a billable feature. Refer to the [product pricing](https://www.scaleway.com/en/pricing/?tags=available,managedservices-observability-cockpit) page for more information.
32-
</Message>
29+
Prometheus federation is usefull to gather all or your metrics in a unique Prometheus insance, or downsampling your different metrics to reduce the storage used by your metrics.
30+
Since you have full control over your Prometheus instance, you can also use federation to increase metrics retention.
3331

3432
## Configure your Prometheus
3533

@@ -38,7 +36,7 @@ Make sure you replace `$SCW_DATASOURCE_URL` with the URL of your data source. Th
3836

3937
```yaml
4038
global:
41-
scrape_interval: 60s
39+
scrape_interval: 3m
4240

4341
scrape_configs:
4442
- job_name: 'federate-scaleway-metrics'
@@ -50,8 +48,8 @@ scrape_configs:
5048
- '$SCW_READ_TOKEN'
5149
params:
5250
'match[]':
53-
- '{__name__="my-scaleway-metrics"}'
54-
- '{job="my-wanted-job"}'
51+
- '{__name__="instance_server_cpu_seconds_total"}'
52+
- '{region="fr-par"}'
5553
static_configs:
5654
- targets:
5755
- '$SCW_DATASOURCE_URL'
@@ -62,12 +60,15 @@ scrape_configs:
6260
</Message>
6361

6462
Modify the different `match[]` parameters according to the metrics you want to retrieve. In this example, you will federate:
65-
- All metrics called `my-scaleway-metrics`
66-
- All metrics with the label `job` with the value `my-wanted-job`
63+
- All metrics called `instance_server_cpu_seconds_total`
64+
- All metrics with the label `region` with the value `fr-par`
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.
6768

6869
## Run your Prometheus instance
6970

70-
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 product metrics.
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.
7172

7273
1. Create a `docker-compose.yml` file with:
7374
```yaml
@@ -83,4 +84,18 @@ Once you have configured your `prometheus.yml` file, you can use docker-compose
8384
- '--config.file=/etc/prometheus/prometheus.yml'
8485
```
8586

86-
2. Go to `http://localhost:9090/targets` and you should see your newly created target, federating your Scaleway product metrics.
87+
2. Go to `http://localhost:9090/targets` and you should see your newly created target, federating your Scaleway metrics.
88+
89+
## Monitor your federation volumes
90+
91+
You can monitor the amout of samples federated with the `/federate` endpoint by looking at the `observability_cockpit_federate_exported_sample_total:increase5m` in your Cockpit.
92+
The metrics indicate the total of exported metrics by federation, over 5 min interval.
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
98+
99+
<Message type="info">
100+
You can federate this metrics to have monitor your volume of federated metrics in your Prometheus instance.
101+
</Message>

0 commit comments

Comments
 (0)