Menu
Grafana Cloud

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, 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
log_file = /Path/to/log/dir/<service>.log
level =  WARNING
  • Other possible level options are DEBUG, INFO, and ERROR.
  1. Restart the service:
bash
systemctl restart <service-name>
  1. 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 Agent 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
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
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
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 component to discover your OpenStack Prometheus endpoint and apply appropriate labels, followed by a 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
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 component to collect OpenStack service logs.

If you configure logging to a file for your OpenStack services, refer to the loki.source.file component documentation.

Grafana Agent static configuration (deprecated)

The following section shows configuration for running Grafana Agent in static mode which is deprecated. You should use Grafana Alloy for all new deployments.

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 overview (services)

OpenStack Nova

OpenStack Nova

OpenStack Neutron (networks)

OpenStack Neutron (networks)

Alerts

The OpenStack integration includes the following useful alerts:

openstack-alerts-openstack

AlertDescription
OpenStackGlanceIsDownCritical: OpenStack Glance is down.
OpenStackHeatIsDownCritical: OpenStack Heat is down.
OpenStackIdentityIsDownCritical: OpenStack Identity is down.
OpenStackPlacementIsDownCritical: OpenStack Placement is down.
OpenStackPlacementHighMemoryUsageWarningWarning: OpenStack is using a significant percentage of its allocated memory.
OpenStackNovaAgentDownCritical: OpenStack is using a large percentage of its allocated memory, consider allocating more resources.
OpenStackPlacementHighVCPUUsageWarningWarning: OpenStack is using a significant percentage of its allocated vCPU.
OpenStackPlacementHighVCPUUsageCriticalCritical: OpenStack is using a large percentage of its allocated vCPU, consider allocating more resources.
OpenStackNeutronHighIPsUsageWarningWarning: Free IP addresses are running out.
OpenStackNeutronHighIPsUsageCriticalCritical: There are practically no free IP addresses left.

openstack-nova-alertsopenstack

AlertDescription
OpenStackNovaIsDownCritical: OpenStack Nova service is down.
OpenStackNovaAgentIsDownCritical: OpenStack Nova agent is down on the specific node.
OpenStackNovaHighVMMemoryUsageWarning: VMs are using a high percentage of their allocated memory.
OpenStackNovaHighVMVCPUUsageWarning: VMs are using a high percentage of their allocated virtual CPUs.

openstack-neutron-alertsopenstack

AlertDescription
OpenStackNeutronIsDownCritical: OpenStack Neutron is down.
OpenStackNeutronAgentIsDownCritical: OpenStack Neutron agent is down on the specific node.
OpenStackNeutronL3AgentIsDownCritical: OpenStack Neutron L3 agent is down on the specific node.
OpenStackNeutronHighDisconnectedPortRateCritical: A high rate of ports have no IP addresses assigned to them.
OpenStackNeutronHighInactiveRouterRateCritical: A high rate of routers are currently inactive.

openstack-cinder-alertsopenstack

AlertDescription
OpenStackCinderIsDownCritical: OpenStack Cinder is down.
OpenStackCinderAgentIsDownCritical: OpenStack Cinder agent is down on the specific node.
OpenStackCinderHighPoolCapacityUsageWarning: Cinder pools are using a large amount of their maximum capacity.
OpenStackCinderHighVolumeMemoryUsageWarning: Cinder volumes are using a large amount of their maximum memory.
OpenStackCinderHighBackupMemoryUsageWarning: 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
# 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 and Cloud tier pricing.