Skip to main content

How to connect Prometheus

Prometheus can only show a limited amount of monitoring data. If you have a large infrastructure, consider connecting a data source in Grafana® instead
  1. Issue a static API key in Nebius Token Factory UI.
  2. Download the latest release of Prometheus for your platform.
  3. Extract the contents and switch to the folder with Prometheus:
    tar xvfz prometheus-***.tar.gz
    cd prometheus-***
    
  4. Create the prometheus.yml configuration file that configures Prometheus to retrieve Monitoring metrics. Use one of the following configurations depending on your Prometheus version:
scrape_configs:
  - job_name: 'Export time series from Nebius Monitoring'
    honor_labels: true
    scrape_interval: 15s
    scheme: https
    metrics_path: '/projects/<project_ID>/service-provider/prometheus/federate'
    params:
      match[]:
        - '{__name__=~".+"}'
    bearer_token: '<static_API_key>'
    static_configs:
      - targets:
        - 'read.monitoring.api.nebius.cloud'
In this file, change the following parameters:
  • bearer_token: enter the static key that you got earlier.
  • metrics_path: specify your project ID in the URL. To get the project ID, go to the Nebius Token Factory UI →  Project settings. Under the project’s name, click  → Copy project ID.
  • match[]: optionally specify which data Prometheus collects by filtering for labels or metric names. For example, to collect only metrics with the disk prefix, set the following value:
    match[]:
      - '{__name__=~"^disk.*"}'
    
  • scrape_interval: you can change the interval, but the recommended interval is no less than 15 seconds.
Start Prometheus:
./prometheus --config.file=prometheus.yml

How to use Grafana®

To view visualized metrics in Grafana dashboards, connect Grafana to Monitoring and query the data by using PromQL.
This method only works for metrics provided by Nebius Token Factory. To visualize your own metrics in Grafana, see Connect Grafana to view your own metrics.

How to connect Grafana data source

Use one of these ways:
This will lead you to the separate product of Nebius. It will require to create a separate account in Nebius AI Cloud product.
Install the Grafana® solution by Nebius, an application for Managed Service for Kubernetes®. The application is configured to receive metrics.

How to explore and manage metrics

Explore the metrics: construct PromQL queries by using Builder or create dashboards to visualize metrics.For example, if you are looking to optimize costs, find virtual machines with consistently underutilized CPUs. Enter the following query:
{"system.cpu.load_average.15m", instance_id=~"computeinstance-.*"}

The Grafana Labs Marks are trademarks of Grafana Labs, and are used with Grafana Labs’ permission. We are not affiliated with, endorsed or sponsored by Grafana Labs or its affiliates.