---
title: "OpenStack integration | Grafana Cloud documentation"
description: "Learn about OpenStack Grafana Cloud integration."
---

# OpenStack integration for Grafana Cloud

OpenStack is an open-source cloud computing platform that facilitates the management of large pools of computing, storage, and networking resources in a data center. It provides scalable Infrastructure as a Service (IaaS) with multiple storage options, networking, IAM, monitoring, and more all built-in to the platform.

This integration supports Openstack 2023.2 Bobcat+.

This integration includes 24 useful alerts and 5 pre-built dashboards to help monitor and visualize OpenStack metrics and logs.

## Before you begin

#### OpenStack prometheus exporter

This integration supports metrics and logs from an OpenStack cloud. It is configured to work with the [OpenStack Prometheus Exporter](https://github.com/openstack-exporter/openstack-exporter), which must be installed and configured separately from Grafana Alloy. Follow instructions in exporter repo to configure the exporter, referring to `/etc/openstack/clouds.yaml` for the possible names of clouds to monitor.

#### Logging to a file (optional)

This integration collects logs from journald, assuming that logging to a file is not configured. If you wish to configure a log file for your OpenStack services:

1. Create a `<service>.log` file.
2. Edit the `<service>.conf` file to include `log_file` and `level` config options.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
log_file = /Path/to/log/dir/<service>.log
level =  WARNING
```

- Other possible `level` options are `DEBUG`, `INFO`, and `ERROR`.

<!--THE END-->

3. Restart the service:

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
systemctl restart <service-name>
```

4. Repeat steps 1-3 for each service.

## Install OpenStack integration for Grafana Cloud

1. In your Grafana Cloud stack, click **Connections** in the left-hand menu.
2. Find **OpenStack** and click its tile to open the integration.
3. Review the prerequisites in the **Configuration Details** tab and set up Grafana Alloy to send OpenStack metrics and logs to your Grafana Cloud instance.
4. Click **Install** to add this integration’s pre-built dashboards and alerts to your Grafana Cloud instance, and you can start monitoring your OpenStack setup.

## Configuration snippets for Grafana Alloy

### Simple mode

These snippets are configured to scrape a single OpenStack cloud with Grafana Alloy running locally.

Copy and Paste the following snippets into your Grafana Alloy configuration file.

### Metrics snippets

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
discovery.relabel "openstack_metrics" {
  targets = [{
    __address__ = "localhost:9090",
  }]

  rule {
    target_label = "instance"
    replacement  = constants.hostname
  }
}

prometheus.scrape "openstack_metrics" {
  targets      = discovery.relabel.openstack_metrics.output
  forward_to   = [prometheus.remote_write.metrics_service.receiver]
  job_name     = "integrations/openstack"
  metrics_path = "/metrics"
}
```

### Logs snippets

#### all

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
loki.process "logs_integrations_openstack" {
  forward_to = [loki.write.grafana_cloud_loki.receiver]
  stage.multiline {
    firstline = "(?P<level>(DEBUG|INFO|WARNING|ERROR)) "
  }
  stage.regex {
    expression = "(?P<level>(DEBUG|INFO|WARNING|ERROR)) (?P<service>\\w+)[\\w|.]+ (\\[.*] )(?P<message>.*)"
  }
  stage.labels {
    values = {
      level     = "",
      service   = "",
    }
  }
}
loki.relabel "logs_integrations_openstack" {
  forward_to = [loki.process.logs_integrations_openstack.receiver]

  rule {
    source_labels = ["__journal_systemd_unit"]
    target_label  = "unit"
  }
}
loki.source.journal "logs_integrations_openstack" {
  max_age = "12h"
  labels  = {
    job      = "integrations/openstack",
    instance = constants.hostname,
  }
  forward_to = [loki.process.logs_integrations_openstack.receiver]
}
```

### Advanced mode

The following snippets provide examples to guide you through the configuration process.

To instruct Grafana Alloy to scrape your OpenStack cloud, **manually** copy and append the snippets to your alloy configuration file, then follow subsequent instructions.

### Advanced metrics snippets

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
discovery.relabel "openstack_metrics" {
  targets = [{
    __address__ = "localhost:9090",
  }]

  rule {
    target_label = "instance"
    replacement  = constants.hostname
  }
}

prometheus.scrape "openstack_metrics" {
  targets      = discovery.relabel.openstack_metrics.output
  forward_to   = [prometheus.remote_write.metrics_service.receiver]
  job_name     = "integrations/openstack"
  metrics_path = "/metrics"
}
```

To monitor an OpenStack instance, you must use a [discovery.relabel](/docs/alloy/latest/reference/components/discovery.relabel/) component to discover your OpenStack Prometheus endpoint and apply appropriate labels, followed by a [prometheus.scrape](/docs/alloy/latest/reference/components/prometheus.scrape) component to scrape it.

Configure the following properties within the `discovery.relabel` component:

- `__address__`: change this from `localhost:9090` to the host and port of the remote OpenStack Prometheus metrics endpoint.
- `constants.hostname`: the snippets set the `instance` label to your Grafana Alloy server hostname using the `constants.hostname` variable. If you are running Grafana Alloy outside of your OpenStack server host, change the variable to a value that uniquely identifies it.

If you have multiple OpenStack servers to scrape, configure one `discovery.relabel` for each and scrape them by including each under `targets` within the `prometheus.scrape` component.

### Advanced logs snippets

#### linux

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
loki.process "logs_integrations_openstack" {
  forward_to = [loki.write.grafana_cloud_loki.receiver]
  stage.multiline {
    firstline = "(?P<level>(DEBUG|INFO|WARNING|ERROR)) "
  }
  stage.regex {
    expression = "(?P<level>(DEBUG|INFO|WARNING|ERROR)) (?P<service>\\w+)[\\w|.]+ (\\[.*] )(?P<message>.*)"
  }
  stage.labels {
    values = {
      level     = "",
      service   = "",
    }
  }
}
loki.relabel "logs_integrations_openstack" {
  forward_to = [loki.process.logs_integrations_openstack.receiver]

  rule {
    source_labels = ["__journal_systemd_unit"]
    target_label  = "unit"
  }
}
loki.source.journal "logs_integrations_openstack" {
  max_age = "12h"
  labels  = {
    job      = "integrations/openstack",
    instance = constants.hostname,
  }
  forward_to = [loki.process.logs_integrations_openstack.receiver]
}
```

This integration uses the [`loki.source.journal`](/docs/alloy/latest/reference/components/loki.source.journal/) component to collect OpenStack service logs.

If you configure logging to a file for your OpenStack services, refer to the [`loki.source.file`](/docs/alloy/latest/reference/components/loki.source.file/) component documentation.

## Dashboards

The OpenStack integration installs the following dashboards in your Grafana Cloud instance to help monitor your system.

- OpenStack Cinder
- OpenStack Neutron
- OpenStack Nova
- OpenStack logs
- OpenStack overview

**OpenStack overview (services)**

**OpenStack Nova**

**OpenStack Neutron (networks)**

## Alerts

The OpenStack integration includes the following useful alerts:

**openstack-alerts-openstack**

Expand table

| Alert                                    | Description                                                                                                  |
|------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| OpenStackGlanceIsDown                    | Critical: OpenStack Glance is down.                                                                          |
| OpenStackHeatIsDown                      | Critical: OpenStack Heat is down.                                                                            |
| OpenStackIdentityIsDown                  | Critical: OpenStack Identity is down.                                                                        |
| OpenStackPlacementIsDown                 | Critical: OpenStack Placement is down.                                                                       |
| OpenStackPlacementHighMemoryUsageWarning | Warning: OpenStack is using a significant percentage of its allocated memory.                                |
| OpenStackNovaAgentDown                   | Critical: OpenStack is using a large percentage of its allocated memory, consider allocating more resources. |
| OpenStackPlacementHighVCPUUsageWarning   | Warning: OpenStack is using a significant percentage of its allocated vCPU.                                  |
| OpenStackPlacementHighVCPUUsageCritical  | Critical: OpenStack is using a large percentage of its allocated vCPU, consider allocating more resources.   |
| OpenStackNeutronHighIPsUsageWarning      | Warning: Free IP addresses are running out.                                                                  |
| OpenStackNeutronHighIPsUsageCritical     | Critical: There are practically no free IP addresses left.                                                   |

**openstack-nova-alertsopenstack**

Expand table

| Alert                          | Description                                                               |
|--------------------------------|---------------------------------------------------------------------------|
| OpenStackNovaIsDown            | Critical: OpenStack Nova service is down.                                 |
| OpenStackNovaAgentIsDown       | Critical: OpenStack Nova agent is down on the specific node.              |
| OpenStackNovaHighVMMemoryUsage | Warning: VMs are using a high percentage of their allocated memory.       |
| OpenStackNovaHighVMVCPUUsage   | Warning: VMs are using a high percentage of their allocated virtual CPUs. |

**openstack-neutron-alertsopenstack**

Expand table

| Alert                                    | Description                                                           |
|------------------------------------------|-----------------------------------------------------------------------|
| OpenStackNeutronIsDown                   | Critical: OpenStack Neutron is down.                                  |
| OpenStackNeutronAgentIsDown              | Critical: OpenStack Neutron agent is down on the specific node.       |
| OpenStackNeutronL3AgentIsDown            | Critical: OpenStack Neutron L3 agent is down on the specific node.    |
| OpenStackNeutronHighDisconnectedPortRate | Critical: A high rate of ports have no IP addresses assigned to them. |
| OpenStackNeutronHighInactiveRouterRate   | Critical: A high rate of routers are currently inactive.              |

**openstack-cinder-alertsopenstack**

Expand table

| Alert                                | Description                                                               |
|--------------------------------------|---------------------------------------------------------------------------|
| OpenStackCinderIsDown                | Critical: OpenStack Cinder is down.                                       |
| OpenStackCinderAgentIsDown           | Critical: OpenStack Cinder agent is down on the specific node.            |
| OpenStackCinderHighPoolCapacityUsage | Warning: Cinder pools are using a large amount of their maximum capacity. |
| OpenStackCinderHighVolumeMemoryUsage | Warning: Cinder volumes are using a large amount of their maximum memory. |
| OpenStackCinderHighBackupMemoryUsage | Warning: Cinder backups are using a large amount of their maximum memory. |

## Metrics

The most important metrics provided by the OpenStack integration, which are used on the pre-built dashboards and Prometheus alerts, are as follows:

- openstack\_cinder\_agent\_state
- openstack\_cinder\_limits\_backup\_max\_gb
- openstack\_cinder\_limits\_backup\_used\_gb
- openstack\_cinder\_limits\_volume\_max\_gb
- openstack\_cinder\_limits\_volume\_used\_gb
- openstack\_cinder\_pool\_capacity\_free\_gb
- openstack\_cinder\_pool\_capacity\_total\_gb
- openstack\_cinder\_snapshots
- openstack\_cinder\_up
- openstack\_cinder\_volume\_status\_counter
- openstack\_cinder\_volumes
- openstack\_glance\_image\_bytes
- openstack\_glance\_images
- openstack\_glance\_up
- openstack\_heat\_up
- openstack\_identity\_domains
- openstack\_identity\_project\_info
- openstack\_identity\_projects
- openstack\_identity\_regions
- openstack\_identity\_up
- openstack\_identity\_users
- openstack\_neutron\_agent\_state
- openstack\_neutron\_floating\_ips
- openstack\_neutron\_floating\_ips\_associated\_not\_active
- openstack\_neutron\_l3\_agent\_of\_router
- openstack\_neutron\_network\_ip\_availabilities\_total
- openstack\_neutron\_network\_ip\_availabilities\_used
- openstack\_neutron\_networks
- openstack\_neutron\_port
- openstack\_neutron\_ports
- openstack\_neutron\_ports\_lb\_not\_active
- openstack\_neutron\_ports\_no\_ips
- openstack\_neutron\_router
- openstack\_neutron\_routers
- openstack\_neutron\_routers\_not\_active
- openstack\_neutron\_security\_groups
- openstack\_neutron\_subnets
- openstack\_neutron\_up
- openstack\_nova\_agent\_state
- openstack\_nova\_limits\_instances\_max
- openstack\_nova\_limits\_instances\_used
- openstack\_nova\_limits\_memory\_max
- openstack\_nova\_limits\_memory\_used
- openstack\_nova\_limits\_vcpus\_max
- openstack\_nova\_limits\_vcpus\_used
- openstack\_nova\_total\_vms
- openstack\_nova\_up
- openstack\_placement\_resource\_total
- openstack\_placement\_resource\_usage
- openstack\_placement\_up
- up

## Changelog

md ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```md
# 1.1.1 - November 2024

- Update status panel check queries

# 1.1.0 - July 2024

- Mixin updates:
  - Add new alerts
  - Update panels

# 1.0.0 - March 2024

- Initial release
```

## Cost

By connecting your OpenStack instance to Grafana Cloud, you might incur charges. To view information on the number of active series that your Grafana Cloud account uses for metrics included in each Cloud tier, see [Active series and dpm usage](/docs/grafana-cloud/fundamentals/active-series-and-dpm/) and [Cloud tier pricing](/products/cloud/pricing/).
