2024-10-30 20:26:28 +01:00

4.3 KiB

Home Assistant Community Add-on: Prometheus

....

Installation

The installation of this add-on is pretty straightforward and not different in comparison to installing any other Home Assistant add-on.

  1. Search for the "Prometheus" add-on in the Supervisor add-on store.
  2. Install the "Prometheus" add-on.
  3. Start the "Prometheus" add-on.
  4. Check the logs of the "Prometheus" to see if everything went well.
  5. Open the Web UI.

Note: The addon supports both Ingress and direct access, this is the default

Configuration

There are no configuration options for the addon.

To add additional scrape targets you need to create a file per target in /share/prometheus/targets.

Example:

---
job_name: "octoprint"
scrape_interval: 5s
metrics_path: "/plugin/prometheus_exporter/metrics"
params:
  apikey: ["VERYSECRETAPIKEY"]
static_configs:
  - targets: ["octoprint.example.org:5000"]

Note: This is just an example, don't copy and paste it! Create your own!

The job names home-assistant and prometheus are already defined by default. For the homeassistant target you must add add the following to the Home Assistant configuration:

prometheus:

Rules can be created under /share/prometheus/rules/

The addon will reload the configuration if a valid configuration is available. If not it will log errors in the addon log

Grafana

Grafana can use prometheus as a datasource, to configure this go to grafana and add a datasource. The hostname to connect to is depending on the release you installed. For stable this is http://a0d7b954-prometheus:9090

Known issues and limitations

  • Job name must be unique, but this has to be enforced by the user.
  • no alert manager yet

Changelog & Releases

This repository keeps a change log using GitHub's releases functionality.

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Support

Got questions?

You have several options to get them answered:

You could also open an issue here GitHub.

Authors & contributors

The original setup of this repository is by Robbert Müller.

For a full list of all authors and contributors, check the contributor's page.

License

MIT License

Copyright (c) 2020-2022 Robbert Müller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.