{"id":28205175,"url":"https://github.com/ome/ansible-role-prometheus","last_synced_at":"2025-06-14T12:31:45.572Z","repository":{"id":54740938,"uuid":"82566008","full_name":"ome/ansible-role-prometheus","owner":"ome","description":"Prometheus monitoring server","archived":false,"fork":false,"pushed_at":"2024-03-20T11:12:19.000Z","size":92,"stargazers_count":16,"open_issues_count":1,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-05T06:56:30.647Z","etag":null,"topics":["ansible","monitoring","prometheus"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ome/prometheus","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-02-20T14:19:48.000Z","updated_at":"2025-03-04T19:25:07.000Z","dependencies_parsed_at":"2023-12-19T00:30:51.085Z","dependency_job_id":"74364e23-90cc-42a6-ad6a-690b55544066","html_url":"https://github.com/ome/ansible-role-prometheus","commit_stats":{"total_commits":80,"total_committers":6,"mean_commits":"13.333333333333334","dds":0.25,"last_synced_commit":"3863dc0bebd96ff97c02d53f9825b1b2302ac0e3"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ome/ansible-role-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ome%2Fansible-role-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ome%2Fansible-role-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ome%2Fansible-role-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ome%2Fansible-role-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ome","download_url":"https://codeload.github.com/ome/ansible-role-prometheus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ome%2Fansible-role-prometheus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259748411,"owners_count":22905519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","monitoring","prometheus"],"created_at":"2025-05-17T08:13:32.947Z","updated_at":"2025-06-14T12:31:45.562Z","avatar_url":"https://github.com/ome.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"Prometheus\n==========\n\n[![Actions Status](https://github.com/ome/ansible-role-prometheus/workflows/Molecule/badge.svg)](https://github.com/ome/ansible-role-prometheus/actions)\n[![Ansible Role](https://img.shields.io/badge/ansible--galaxy-prometheus-blue.svg)](https://galaxy.ansible.com/ui/standalone/roles/ome/prometheus/)\n\nPrometheus monitoring server, includes prometheus, alertmanager and blackbox-exporter.\nThis requires docker to be running (not handled by this role).\n\nThis role is still in development.\n\n\nParameters\n----------\n\n- `prometheus_targets`: Optional list of dictionaries of targets:\n  - `group`: A list of Ansible groups (optional)\n  - `hosts`: A list of hosts (optional)\n  - `port`: The port to be monitored\n  - `jobname`: The prometheus job-name\n  - `scrape_interval`: Prometheus scrape interval (optional)\n  - `metrics_path`: Path to metrics (optional)\n- `prometheus_sd_targets`: Optional list of dictionaries of additional targets:\n  - `groupname`: The name of the configuration target file, used to name a configuration file so must be unique\n  - `group`: A list of Ansible groups (optional)\n  - `hosts`: A list of hosts (optional)\n  - `port`: The port to be monitored\n  - `jobname`: The prometheus job-name\n\n  This is intended to be an example.\n  In practice these configuration files could be dynamically generated outside this role, prometheus will automatically reload them.\n- `prometheus_custom_targets`: Optional list of dictionaries of additional targets with custom arguments, use this if you need to pass custom arguments that aren't supported by the previous two parameters.\n  Each item is a [`\u003cscrape_config\u003e`](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config) that will be copied unchanged into the configuration.\n- `prometheus_port`: External Prometheus port, set to `0` to disable, default `9090`\n- `prometheus_alertmanager_port`: External Alertmanager port, set to `0` to disable, default `9093`\n- `prometheus_blackboxexporter_port`: External Blackbox-exporter port, set to `0` to disable, default `9115`\n- `prometheus_additional_command_args`: Additional command line arguments for prometheus\n- `prometheus_alertmanager_additional_command_args`: Additional command line arguments for alertmanager\n- `prometheus_additional_rules_template`: Template with additional alert rules.\n  See https://awesome-prometheus-alerts.grep.to/rules for some ideas but note the labels may be different.\n\n\n- `prometheus_docker_network`: Docker network for prometheus Docker applications, default `prometheus`\n- `prometheus_docker_user`: User ID that prometheus should run as, default is the container default\n- `prometheus_docker_data_volume`: Docker volume or host path for Prometheus data, default is a docker volume called `prometheus-data`. If this is a host path it must be writeable by `prometheus_docker_user`.\n\n\nOutputs\n-------\nThis role sets the following variables which can be used in other tasks:\n- `prometheus_internal_ip`: Internal IP of the Prometheus container\n- `prometheus_blackboxexporter_internal_ip`: Internal IP of the Blackbox exporter container\n- `prometheus_alertmanager_internal_ip`: Internal IP of the AlertManager container\n\nThese are intended for use when you don't want to expose the container ports using standard Docker port-forwarding (set `prometheus_*port: 0`).\n\n\nExample playbook\n----------------\n\n    - hosts: localhost\n      roles:\n      - role: ome.docker\n      - role: ome.prometheus\n\n\nTesting Slack alerts (manual)\n-----------------------------\n\nChange `prometheus_alertmanager_slack_webhook` in `playbook.yml` to a real Slack webhook. Run:\n\n    molecule test --destroy never\n    molecule login\n    docker stop fake-metrics\n\nWait a few minutes, a Slack alert should be generated.\n\nIf this fails try creating a [manual alert](https://github.com/prometheus/alertmanager/issues/437#issuecomment-263413632):\n\n    curl -H \"Content-Type: application/json\" -d '[{\"labels\":{\"alertname\":\"TestAlert1\"}}]' localhost:9093/api/v1/alerts\n\nThe molecule test also includes a disk space alert configuration.\nTo test this fill up at least 90% of the `/run` partition:\n\n    molecule login\n    dd if=/dev/zero of=/run/fill.space bs=1M count=...\n\nWait a few minutes and you should see a disk space warning.\n\n\nAuthor Information\n------------------\n\nome-devel@lists.openmicroscopy.org.uk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fome%2Fansible-role-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fome%2Fansible-role-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fome%2Fansible-role-prometheus/lists"}