{"id":18300018,"url":"https://github.com/chorusone/menoetius","last_synced_at":"2025-10-17T05:19:38.534Z","repository":{"id":56342120,"uuid":"142179078","full_name":"ChorusOne/menoetius","owner":"ChorusOne","description":"Scrape and Push Daemon for Prometheus","archived":false,"fork":false,"pushed_at":"2020-11-27T17:11:51.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-02-15T03:29:45.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChorusOne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-24T15:35:51.000Z","updated_at":"2020-11-27T17:11:53.000Z","dependencies_parsed_at":"2022-08-15T17:00:30.084Z","dependency_job_id":null,"html_url":"https://github.com/ChorusOne/menoetius","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fmenoetius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fmenoetius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fmenoetius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fmenoetius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChorusOne","download_url":"https://codeload.github.com/ChorusOne/menoetius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248010211,"owners_count":21032868,"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":[],"created_at":"2024-11-05T15:11:08.466Z","updated_at":"2025-10-17T05:19:33.502Z","avatar_url":"https://github.com/ChorusOne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Menoetius\n## Version: 0.3.0\n\n### What is Menoetius\n\nMenoetius is a small python application that will, given a config file, scrape Prometheus /metrics endpoints and push the scraped data on a schedule to a PushGateway.\n\nThis essentially allows us to run entire Prometheus clusters to a push-model, as opposed to the standard pull-model usage.\n\nIn most scenarios, this is not required - however, if security rules do not permit read access into certain subnets/host/environments (for example, monitoring hosts in restrictive subnet from a less restricted subnet), but those hosts are free to connect out, then the push-model is perfectly suited.\n\nPrometheus provides the PushGateway, that can have metrics pushed to it and be itself scraped by Prometheus - but to our knowledge, no such utility exists to push the output from /metrics endpoints to this gateway, leaving the push gateway more suited to custom metrics / batch scripts, etc. Until Menoetius.\n\n#### Why Menoetius?\n\nIn Greek mythology, Menoetius was the brother of Prometheus. Epimitheus was already taken by a Prometheus-related project. That's enough of a tenuous link for me :)\n\n#### Pronunciation\n\nMen-ee-te-us\n\n### Installation\n\nInstall, using your operating system's package manager, `python3` and `pip3-python`.\n\nThe follow these simple instructions:\n\n1. Clone the contents of this repository (into `/srv/menoetius`, for example). This will be referred to herein as the 'application root'.\n* From your application root, run `pip3 install -r requirements.txt` or install deps via your distribution package manager, for example `apt install python3-requests python3-yaml`\n* Create `config.yaml` file in the application root (see 'Configuration' section below)\n* Run `python3 ./menoetius.py` (or run as a service, see 'Running Menoetius as a service' section below)\n\n### Configuration\nMenoetius has a small number of configurable items, all of which can be configured by way of a YAML file in the application root; or a path of your choosing using the `MENOETIUS_CONFIG_PATH` environment variable.\n\nExample configuration:\n```\ngateways:\n- http://prometheus.example.com:9091\nlog_level: info\nlog_format: \"%(asctime)-15s [%(levelname)s] (%(threadName)-10s) %(message)s\"\nlog_file: menoetius.log\nrequest_timeout: 5\nendpoints:\n  - name: monitor\n    scheme: http\n    host: localhost\n    port: 9100\n    path: /metrics\n    interval: 5\n    hostname: host.domain.com\n    labels:\n      arbitrary_label: foo\n      other_label: bar\nhelp_overrides:\n  go_memstats_sys_bytes: Number of bytes obtained by system.\n```\n\n#### gateway\n**(no default; REQUIRED)**\n\nThis is a list of http(s) addresses of your Prometheus pushgateway(s), that you want Menoetius to push all metrics to.\n\n#### log_level\n**(default: info)**\n\nThe minimum log level for which messages should be emitted to the log file. Standard Python logging module log levels: debug, info, warning, error, critical (see: https://docs.python.org/3/library/logging.html)\n\n#### log_format\n**(default: \"%(asctime)-15s [%(levelname)s] (%(threadName)-10s) %(message)s\")**\n\nThe log format of messages emitted to the log file. Standard Python logging module log format (see: https://docs.python.org/3/library/logging.html)\n\n#### log_file\n**(default: menoetius.log)**\n\nThe path of the log file. Can be relative (to the application root) or absolute.\n\n#### request_timeout\n**(default: 5)**\n\nThe number of seconds allowed to elapse before the POST request to the push gateway will timeout.\n\n#### help_overrides\n**(no default; not required)**\n\nPrometheus pushgateway will emit a log for every push it receives where the HELP label for a metric doesn't exactly match the HELP label for metrics of the same name that it has received from other sources. An example of this is the `go_memstats_sys_bytes` internal Go metric, for which the HELP label changes between versions 0.8.0 and 0.9.0 of the Prometheus golang client (see: https://github.com/prometheus/client_golang/commit/9a6b9d3ddfdffd6edd5cccc94cc6623821c87075#diff-c7cee965d0cb37a1f58780f5184a17ba).\n\nThe `help_overrides` setting allows us to optionally define a map of metric names and strings with which to override the HELP labels for those metrics.\n\n#### endpoints\n**(no default; REQUIRED)**\n\nThe `endpoints` setting is a list of endpoints that Menoetius will poll for metrics.\n\nEach `endpoint` is a map comprising fhe follow settings:\n\n##### name\n**(no default; REQUIRED)**\n\nA user friendly label to identify the source of the metrics; it is used as the value of `job` within Prometheus.\n\n##### scheme\n**(default: http)**\n\nThe scheme Menoetius will use to scrape metrics; supports any scheme supported by Python's `requests` module (see: http://python-requests.org)\n\n##### host\n**(default: localhost)**\n\nThe hostname of the endpoint Menoetius will scrape for metrics.\n\n##### port\n**(default: 9100)**\n\nThe port of the endpoint Menoetius will scrape for metric (9100 = node_exporter)\n\n##### path\n**(default: /metrics)**\n\nThe path of the endpoint Menoetius will scrape for metrics.\n\n##### interval\n**(default: 30)**\n\nThe number of seconds that will elapse between repeated requests. Subsequent requests will not execute if a previous request is still running.\n\n##### hostname\n**(default: `\u003cFQDN of the host\u003e`)**\n\nThe hostname with which we wish to associate the pushed metrics; it forms the `instance` value within Prometheus.\n\nBy default this is the output from `getfqdn()` method on the Python `socket` module, unless overridden here.\n\n##### labels\n**(no default; not required)**\n\nAn optional map of additional labels to apply to metrics from the given endpoint.\n\n\n\n\n\n### Running Menoetius as a service\n\nWe recommend running Menoetius as a systemd service.\n\nCreate a text file at `/etc/systemd/system/menoetius.service`, and paste in the following content:\n\n```\n[Unit]\nDescription=menoetius\nAfter=syslog.target network.target\n[Service]\n\nType=simple\nRemainAfterExit=no\nWorkingDirectory=/srv/menoetius\nUser=prometheus\nGroup=prometheus\nExecStart=/usr/bin/python3 /srv/menoetius/menoetius.py\n\n[Install]\nWantedBy=multi-user.target\n```\n\nThe command `sudo systemctl enable menoetius.service` and `sudo systemctl start menoetius.service` will\nenable the service at boot, and start the service running respectively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchorusone%2Fmenoetius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchorusone%2Fmenoetius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchorusone%2Fmenoetius/lists"}