# 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.
1. Install the "Prometheus" add-on.
1. Start the "Prometheus" add-on.
1. Check the logs of the "Prometheus" to see if everything went well.
1. 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:

```yaml
---
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:

```yaml
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][releases]
functionality. The format of the log is based on
[Keep a Changelog][keepchangelog].

Releases are based on [Semantic Versioning][semver], 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:

- The [Home Assistant Community Add-ons Discord chat server][discord] for add-on
  support and feature requests.
- The [Home Assistant Discord chat server][discord-ha] for general Home
  Assistant discussions and questions.
- The Home Assistant [Community Forum][forum].
- Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit]

You could also [open an issue here][issue] GitHub.

## Authors & contributors

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

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

## License

MIT License

Copyright (c) 2020-2020 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.

[contributors]: https://github.com/hassio-addons/addon-Prometheus/graphs/contributors
[discord-ha]: https://discord.gg/c5DvZ4e
[discord]: https://discord.me/hassioaddons
[forum]: https://example.net
[mjrider]: https://github.com/mjrider
[issue]: https://github.com/hassio-addons/addon-prometheus/issues
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
[reddit]: https://reddit.com/r/homeassistant
[releases]: https://github.com/hassio-addons/addon-prometheus/releases
[semver]: http://semver.org/spec/v2.0.0.htm
