---
title: Charmhub | Deploy Prometheus Juju Exporter using Charmhub - The Open Operator
  Collection
description: Deploy the latest version of Prometheus Juju Exporter on any cloud. Charm
  that exports statistics about number of juju-deployed machines
url: https://charmhub.io/prometheus-juju-exporter
---

# Prometheus Juju Exporter

[Canonical BootStack Charmers](https://charmhub.io/publisher/bootstack-charmers "View all packages from Canonical BootStack Charmers")

* [Canonical BootStack Charmers](https://charmhub.io/publisher/bootstack-charmers "View all packages from Canonical BootStack Charmers")

Platform:

22.04

20.04

18.04

stable 23

```
juju deploy prometheus-juju-exporter
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://github.com/canonical/charm-prometheus-juju-exporter)
* [Contact](mailto:LMA Charmers <llama-charmers@lists.ubuntu.com>)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

DEPRECATION NOTICE:

This charm is deprecated. Please consider using the new charm [script-exporter](https://charmhub.io/script-exporter) instead. See the [Migration Guide](https://charmhub.io/prometheus-juju-exporter/docs/h-migration) for more details on how to migrate to the new solution.

# Prometheus Juju Exporter

Prometheus Juju Exporter is a [subordinate machine charm](https://juju.is/docs/sdk/charm-taxonomy#heading--subordinate-charms) that collects statistics about machines deployed by a juju controller and exports them as Prometheus metrics. Core collecting and exporting functionality is implemented in the [Prometheus Juju Exporter snap](https://github.com/canonical/prometheus-juju-exporter).

## [Collected Data](https://charmhub.io/prometheus-juju-exporter#p-26603-collected-data)

The main focus of this exporter is to provide insight about the number of machines managed by the Juju controller and their current states. The installed exporter snap will try to connect to the
controller and crawl through every model, collecting information about deployed machines.
Resulting metrics contain numeric representation `1` (UP) or `0` (DOWN) for each machine deployed
by the controller. In addition, each machine (metric) has labels that help to uniquely identify it:

* hostname - hostname of the machine as reported by Juju
* juju\_model - name of the model in which the machine is deployed
* cloud\_name - name of the cloud that hosts the model
* customer - name of the customer/organization that owns the controller
* type - Distinguishes various host types
* metal - Physical machine
* kvm - Virtual Machine
* lxd - LXD container

Example data:

```
# HELP juju_machine_state Running status of juju machines
# TYPE juju_machine_state gauge
juju_machine_state{customer="DOC",hostname="juju-882749-controller-0",job="prometheus-juju-exporter",cloud_name="openstack-cloud-serverstack",juju_model="controller",type="kvm"} 1.0
juju_machine_state{customer="DOC",hostname="juju-882749-controller-3",job="prometheus-juju-exporter",cloud_name="openstack-cloud-serverstack",juju_model="controller",type="kvm"} 1.0
juju_machine_state{customer="DOC",hostname="juju-ad368d-test-0",job="prometheus-juju-exporter",cloud_name="openstack-cloud-serverstack",juju_model="test",type="kvm"} 1.0
juju_machine_state{customer="DOC",hostname="juju-ad368d-test-1",job="prometheus-juju-exporter",cloud_name="openstack-cloud-serverstack",juju_model="test",type="kvm"} 1.0
```

## [Security, Bugs and feature request](https://charmhub.io/prometheus-juju-exporter#p-26603-security-bugs-and-feature-request)

If you find a bug in this application or want to request a specific feature, here are the useful links:

* Raise issues or feature requests in [Github](https://github.com/canonical/charm-prometheus-juju-exporter/issues)
* Security issues in the Prometheus juju exporter can be reported through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File). Please do not file GitHub issues about security issues.

## [Contributing](https://charmhub.io/prometheus-juju-exporter#p-26603-contributing)

Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on enhancements to this charm following best practice guidelines, and [CONTRIBUTING.md](https://github.com/canonical/charm-prometheus-juju-exporter/blob/main/CONTRIBUTING.md) for developer guidance.

## [License](https://charmhub.io/prometheus-juju-exporter#p-26603-license)

Prometheus Juju Exporter is free software, distributed under the Apache Software License, version 2.0. See [LICENSE](https://github.com/canonical/charm-prometheus-juju-exporter/blob/main/LICENSE) for more information.

---

[Help improve this document in the forum](https://discourse.charmhub.io/t/prometheus-juju-exporter-docs-index/11197) ([guidelines](https://discourse.charmhub.io/t/how-to-write-docs-our-documentation-guidelines-for-contributors/1245)). Last updated 1 year, 4 months ago.
