How to send metrics or logs to Cockpit using OTLP
This guide explains how to configure OpenTelemetry Protocol (OTLP) to push your metrics and logs to Cockpit. You can choose between using a vanilla OTLP exporter or Grafana Alloy as your metrics collector and forwarder.
Before you start
To complete the actions presented below, you must have:
-
Owner status or IAM permissions allowing you to perform actions in the intended Organization
-
A Scaleway account logged into the console
-
A token with push permissions for metrics and/or logs in the same region as your data
-
For vanilla OTLP:
- An OTLP-compatible exporter installed on your system (e.g., OpenTelemetry Collector, otelcol)
- Your metrics or logs endpoint URLs retrieved from the Data sources tab of the Scaleway console
-
For Grafana Alloy: Installed Grafana Alloy
Using a Vanilla OTLP Exporter
This section demonstrates how to configure a standard OTLP exporter to send metrics directly to Cockpit.
-
Install the OpenTelemetry Collector on your system. For example, on macOS using Homebrew:
brew install open-telemetry/opentelemetry-collector/opentelemetry-collector -
Create a configuration file named
otel-collector-config.yaml:receivers: otlp: protocols: grpc: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 processors: batch: timeout: 10s send_batch_size: 1024 exporters: otlphttp/cockpit-metrics: endpoint: "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/otlp/v1/metrics" headers: X-TOKEN: "COCKPIT_TOKEN_SECRET_KEY" otlphttp/cockpit-logs: endpoint: "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.logs.cockpit.fr-par.scw.cloud/otlp/v1/logs" headers: X-TOKEN: "COCKPIT_TOKEN_SECRET_KEY" service: pipelines: metrics: receivers: [otlp] processors: [batch] exporters: [otlphttp/cockpit-metrics] logs: receivers: [otlp] processors: [batch] exporters: [otlphttp/cockpit-logs] -
Replace the following values:
https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/otlp/v1/metricswith your metrics endpoint URLhttps://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.logs.cockpit.fr-par.scw.cloud/otlp/v1/logswith your logs endpoint URL (optional, if sending logs)COCKPIT_TOKEN_SECRET_KEYwith your Cockpit token's secret key
-
Start the OpenTelemetry Collector:
otelcol --config otel-collector-config.yaml -
Configure your applications to send metrics and logs to the collector:
- gRPC endpoint:
localhost:4317 - HTTP endpoint:
localhost:4318
Your applications can send both metrics and logs to the same collector endpoints, which will forward them to the appropriate Cockpit endpoints based on the pipeline configuration.
- gRPC endpoint:
Using Grafana Alloy
Grafana Alloy provides a flexible way to collect, transform, and forward metrics to Cockpit with built-in scraping capabilities.
-
Create a folder named
configon your local machine. -
Inside the
configfolder, create a file namedcockpit.alloy. -
Paste the following template inside
cockpit.alloy:prometheus.exporter.unix "node" { set_collectors = [ "uname", "cpu", "cpufreq", "loadavg", "meminfo", "filesystem", "netdev", ] } prometheus.scrape "node" { scrape_interval = "60s" scrape_timeout = "4s" targets = prometheus.exporter.unix.node.targets forward_to = [prometheus.remote_write.cockpit.receiver] } prometheus.remote_write "cockpit" { endpoint { url = "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/otlp/v1/metrics" headers = { "X-TOKEN" = "COCKPIT_TOKEN_SECRET_KEY", } } } // Optional: Configure logs exporter // otelcol.exporter.otlphttp "cockpit_logs" { // client { // endpoint = "https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.logs.cockpit.fr-par.scw.cloud/otlp/v1/logs" // headers = { // "X-TOKEN" = "COCKPIT_TOKEN_SECRET_KEY", // } // } // } -
Replace the following values:
https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/otlp/v1/metricswith your metrics endpoint URL from the Data sources tabCOCKPIT_TOKEN_SECRET_KEYwith your Cockpit token's secret key- (Optional) Uncomment and configure the logs exporter with your logs endpoint:
https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.logs.cockpit.fr-par.scw.cloud/otlp/v1/logs
-
Open a terminal and start Alloy. For example, on macOS:
brew services start alloy -
In the same terminal, run the following command:
alloy run config/cockpit.alloyThe last lines of your output should look similar to the following:
ts=2026-01-23T14:23:05.542081Z level=info msg="now listening for http traffic" service=http addr=127.0.0.1:12345 ts=2026-01-23T14:23:13.432896Z level=info msg="Done replaying WAL" component_path=/ component_id=prometheus.remote_write.cockpit subcomponent=rw remote_name=aa0551 url=https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/otlp/v1/metrics duration=12.900498616s
Visualizing your metrics
-
Click Cockpit in the Monitoring section of the console side menu. The Cockpit overview page displays.
-
Click Access Grafana to open your preconfigured dashboards in Grafana. You are redirected to the Grafana website.
-
Click the Grafana icon in the top left side of your screen to open the menu.
-
Click Dashboards, then click New in the top right corner of your screen. A drop-down displays.
-
Click Import to import a dashboard.
-
In the Import via grafana.com field, enter
1860, then click Load. -
Enter a name for your dashboard or leave the default one.
-
In the Folder field, select a folder in which to store your dashboard.
-
In the Prometheus field, select your metrics data source from the drop-down.
-
Click Import. Your dashboard should load and display.
-
In the drop-down next to Datasource, select your metrics data source. By default, your dashboard retrieves your data source's data from the last 24 hours.
-
If your data source was created less than 24 hours ago, click the clock icon and adjust the time range to match its creation time.
Your dashboard should now display your metrics collected via OTLP.
Viewing logs
To view logs sent to Cockpit:
-
Click Cockpit in the Monitoring section of the console side menu.
-
Click Access Grafana to open Grafana.
-
Navigate to Explore in the left menu.
-
Select your logs data source from the drop-down.
-
Use LogQL queries to filter and analyze your logs.