-
Notifications
You must be signed in to change notification settings - Fork 243
docs(Cockpit): add new federation documentation for Cockpit - int-add-observability-federate-doc #5179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Katsuyu
wants to merge
17
commits into
scaleway:main
Choose a base branch
from
Katsuyu:int-add-observability-federate-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+118
−0
Open
docs(Cockpit): add new federation documentation for Cockpit - int-add-observability-federate-doc #5179
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f2bc17b
add(observability): new documentation for the federation endpoint of …
038e65f
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu cdd3872
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu 436b1b6
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu 5af3067
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu f4142e1
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu 27acab7
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu dc486fb
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu dc555ac
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu 435bc3e
Update pages/cockpit/how-to/federate-scaleway-metrics.mdx
Katsuyu a82bad7
Update pages/cockpit/reference-content/cockpit-supported-endpoints.mdx
Katsuyu f9251ef
Fix MR conflict
301cbe7
Update doc content
7f9977d
Add reminder about /federate
9cc03c6
add Sophie comment to fix some typos and wording
86645ec
add regex in example
9ca8c34
wording
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
meta: | ||
title: How to federate Scaleway metrics with your own Prometheus | ||
description: Learn how to retrieve your Scaleway metrics with federation and reuse them within your own Prometheus with this step-by-step guide. | ||
content: | ||
h1: How to federate Scaleway metrics with your own Prometheus | ||
paragraph: Learn how to retrieve your Scaleway metrics with federation and reuse them within your own Prometheus with this step-by-step guide. | ||
tags: federation cockpit metrics observability monitoring prometheus | ||
categories: | ||
- observability | ||
dates: | ||
validation: TBD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a reminder to update the dates before publishing |
||
posted: TBD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
--- | ||
|
||
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. | ||
|
||
<Macro id="requirements" /> | ||
|
||
- A Scaleway account logged into the [console](https://console.scaleway.com) | ||
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
- [Created](/cockpit/how-to/create-token/) a Cockpit token with read access in the same region as the metrics data source | ||
- A running [Prometheus](https://prometheus.io) instance | ||
|
||
<Message type="info"> | ||
The `/federate` endpoint will not be billed during the beta phase. After the beta, the endpoint will incur additional costs. | ||
</Message> | ||
|
||
Prometheus federation can be used to gather all your metrics in a unique Prometheus instance, or to downsample different metrics to reduce storage costs in the long run. | ||
Since you have full control over your Prometheus instance, you can also use federation to increase metrics retention. | ||
|
||
## Configure your Prometheus | ||
|
||
Create a `prometheus.yml` file to configure your Prometheus instance, using the example below. | ||
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. | ||
|
||
```yaml | ||
global: | ||
scrape_interval: 3m | ||
|
||
scrape_configs: | ||
- job_name: 'federate-scaleway-metrics' | ||
honor_labels: true | ||
metrics_path: '/federate' | ||
http_headers: | ||
X-Token: | ||
values: | ||
- '$SCW_READ_TOKEN' | ||
params: | ||
'match[]': | ||
Katsuyu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- '{__name__="instance_.*"}' | ||
- '{region="fr-par"}' | ||
static_configs: | ||
- targets: | ||
- '$SCW_DATASOURCE_URL' | ||
``` | ||
|
||
<Message type="important"> | ||
Do not include `https://` in the `SCW_DATASOURCE_URL`. | ||
</Message> | ||
|
||
Katsuyu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Modify the different `match[]` parameters according to the metrics you want to retrieve. In this example, you will federate: | ||
- All metrics with a name that starts with `instance_` | ||
- All metrics with the label `region` with the value `fr-par` | ||
|
||
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. | ||
For example, with `honor_labels` set to `false` the Scaleway label `job` will be relabelled as `exported_job` to avoid collision. | ||
Katsuyu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Run your Prometheus instance | ||
|
||
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. | ||
|
||
1. Create a `docker-compose.yml` file with: | ||
```yaml | ||
services: | ||
prometheus: | ||
image: prom/prometheus:latest | ||
container_name: prometheus | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro | ||
ports: | ||
- 9090:9090 | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
``` | ||
|
||
2. Go to `http://localhost:9090/targets` and you should see your newly created target, federating your Scaleway metrics. | ||
|
||
## Monitor your federation volumes | ||
|
||
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. | ||
This metric indicates the total volume of exported samples through the federation endpoint over a 5 minutes interval. | ||
|
||
1. Go to the Cockpit page on the Scaleway console | ||
2. Click on `Open dashboards` to open your Grafana | ||
3. Go to the Explore tab on the left panel | ||
4. Search for the `observability_cockpit_federate_exported_sample_total:increase5m` metrics | ||
|
||
<Message type="info"> | ||
You can also federate this metrics to monitor your volume of federated metrics directly in your Prometheus instance. | ||
</Message> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Cockpit is the Observability product and that federation is used to setup monitoring, don't you think we should keep these ?
Is it bad to have to many tags ?