---
title: Using your own Grafana with Cockpit
description: Learn how to create data sources for metrics, logs, traces, and alerts in Grafana with our comprehensive tutorial. This guide walks you through setting up and configuring data sources, to monitor and visualize your system's performance effectively.
products:
  - cockpit
tags: metrics logs prometheus loki grafana
dates:
  validation: 2025-07-16
  posted: 2023-05-10
  validation_frequency: 12
difficulty: beginner
usecase:
  - migration
ecosystem:
  - third-party
---
import image from './assets/scaleway_cockpit_tuto_data_source.webp'
import image2 from './assets/scaleway_cockpit_tuto_data_source.webp'

import Requirements from '@macros/iam/requirements.mdx'


In this tutorial, you will learn how to use your own Grafana with [Scaleway's Cockpit](/cockpit/quickstart/) service. In this tutorial, we are using Grafana version 9.5.1.

<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
- Installed [Docker](https://docs.docker.com/engine/install/)
- Downloaded the [latest version of Grafana](https://grafana.com/grafana/download)

## Launching Grafana

1. Run the following command to launch Grafana in a Docker container on your local machine:

        ```bash
        docker run -d -p 3000:3000 grafana/grafana-oss:9.5.1
        ```
2. [Create a token](/cockpit/how-to/create-token/) with the following permissions:
    - Query metrics
    - Query logs
    - Query traces
    - Rules for metrics
    - Rules for logs
    - Alerts

3. Copy your token's secret key as you will need it for the following steps.
4. Open [http://localhost:3000](http://localhost:3000) in a web browser on your local computer to access Grafana.
5. Sign up using `admin` as your username and password. You will then be prompted to change your password.

## Creating your data source for metrics

1. From the Grafana homepage, click **Add your first data source**.
      <Lightbox image={image} alt="" />
2. Select the Prometheus data source in the list that displays.
3. Retrieve the URL of the metrics data source you want to add from the [Data sources tab](https://console.scaleway.com/cockpit/fr-par/dataSource) of the Scaleway console. Make sure that the region in the URL is the one where your data source is located.
4. Add `/prometheus` at the end of the URL. Your metrics' URL should look like the following:
    ```bash
    https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.metrics.cockpit.fr-par.scw.cloud/prometheus
    ```
5. Paste your metrics' URL in the **URL** field of the **HTTP** section.
6. From the **Custom HTTP Headers** section, click **+ Add header**.
7. Enter `X-Token` in the **Header** field.
8. Enter your token's secret key in the **Value** field.
9. From the **Type and version** section, select **Prometheus** in the **Prometheus type** drop-down.
10. Select the latest version in the **Prometheus version** drop-down.
11. Click **Save & test** to confirm.

## Creating your data source for logs

1. From the Grafana homepage, click **Add your first data source**.
      <Lightbox image={image2} alt="" />
2. Select the Loki data source in the list that displays.
3. Retrieve the URL of the logs data source you want to add from the [Data sources tab](https://console.scaleway.com/cockpit/fr-par/dataSource) of the Scaleway console.
4. Paste your logs' URL in the **URL** field of the **HTTP** section.
5. From the **Custom HTTP Headers** section, click **+ Add header**.
6. Enter `X-Token` in the **Header** field.
7. Enter your token's secret key in the **Value** field.
8. Click **Save & test** to confirm.

## Creating your data source for your Alert manager

1. From the Grafana homepage, click **Add your first data source**.
2. Select the **Alertmanager** data source.
3. In the **Alertmanager** section > **Implementation**, select **Mimir** in the drop-down.
4. Copy and paste the following URL in the URL field of the **HTTP** section:
    ```bash
    https://alertmanager.cockpit.fr-par.scw.cloud
    ```
5. From the **Custom HTTP headers** section, click **+ Add header**.
6. Enter `X-Token` in the **Header** field.
7. Enter your token's secret key in the **Value** field.
8. Click **Save & test** to confirm.

## Creating your data source for your traces

1. From the Grafana homepage, click **Add your first data source**.
2. Select the **Tempo** data source in the list that displays.
3. Retrieve the URL of the traces data source you want to add from the [Data sources tab](https://console.scaleway.com/cockpit/fr-par/dataSource) of the Scaleway console.
4. Paste your logs' URL in the **URL** field of the **HTTP** section.
5. From the **Custom HTTP headers**, click **+ Add header**.
6. Enter `X-Token` in the **Header** field.
7. Enter your token's secret key in the **Value** field.
8. Click **Save & test** to confirm.