{"id":13580636,"url":"https://github.com/retzkek/chiamon","last_synced_at":"2026-01-23T14:31:34.885Z","repository":{"id":49530907,"uuid":"361492108","full_name":"retzkek/chiamon","owner":"retzkek","description":"Example Chia monitoring stack","archived":false,"fork":false,"pushed_at":"2021-07-07T18:06:33.000Z","size":42,"stargazers_count":257,"open_issues_count":4,"forks_count":66,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-05T19:44:03.416Z","etag":null,"topics":["chia","chia-exporter","grafana","loki","mtail","prometheus","promtail"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retzkek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-25T17:21:14.000Z","updated_at":"2024-10-30T17:12:36.000Z","dependencies_parsed_at":"2022-07-30T08:18:16.423Z","dependency_job_id":null,"html_url":"https://github.com/retzkek/chiamon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retzkek%2Fchiamon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retzkek%2Fchiamon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retzkek%2Fchiamon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retzkek%2Fchiamon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retzkek","download_url":"https://codeload.github.com/retzkek/chiamon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247426276,"owners_count":20937093,"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":["chia","chia-exporter","grafana","loki","mtail","prometheus","promtail"],"created_at":"2024-08-01T15:01:53.830Z","updated_at":"2026-01-23T14:31:34.839Z","avatar_url":"https://github.com/retzkek.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# ChiaMon\n\nExample Chia monitoring stack, using:\n\n* [mtail](https://github.com/google/mtail) to collect metrics from\n  [Chia](https://chia.net) logs\n* [chia_exporter](https://github.com/retzkek/chia_exporter) to collect metrics\n  from the Chia node\n* [node_exporter](https://github.com/prometheus/node_exporter) or [windows\n  exporter](https://github.com/prometheus-community/windows_exporter/) to\n  collect system metrics\n* [prometheus](https://prometheus.io/) to store metrics\n* [promtail](https://grafana.com/docs/loki/latest/clients/promtail/) and\n  [loki](https://grafana.com/docs/loki/latest/) to collect and store logs from\n  the Chia node and plotters (and system too if desired)\n* [grafana](https://grafana.com) to display everything\n\nThis includes a [docker-compose](https://github.com/docker/compose/)\nconfiguration to run everything, but this is primarily intended for development\nand testing.\n\n**WARNING this is NOT a one-click install, expect to need to do some work\nsetting everything up for your machine. PLEASE read the notes below and\nunderstand what all the services are, what they do, and how they work\ntogether.**\n\n![Chia dashboard](https://img.kmr.me/posts/chiamon3.png)\n\n## mtail program\n\nThe mtail program is in `mtail/chialog.mtail`. Currently it only collects harvester metrics:\n\n* `chia_harvester_blocks_total`: cumulative number of block challenges attempted\n* `chia_harvester_plots_total`: current number of plots\n* `chia_harvester_plots_eligible`: cumulative number of plots that passed filter\n* `chia_harvester_proofs_total`: cumulative number of proofs won\n* `chia_harvester_search_time`: histogram of proof search times\n\n**NOTE** you need to set log_level to INFO in your Chia config.yaml to get harvester metrics.\n\n## chia_exporter\n\nThe [chia_exporter](https://github.com/retzkek/chia_exporter) is used to collect\nmetrics from the Chia node [RPC\nAPI](https://github.com/Chia-Network/chia-blockchain/wiki/RPC-Interfaces).\n\n## Grafana dashboard\n\nThe example Grafana dashboard is in `grafana/dashboards/Chia.json`. It defines a\nnumber of variables that will be auto-populated from the node metrics. Grafana\ndashboards are [easily customized](https://grafana.com/docs/) to show what\nyou're interested in seeing, in the way you find best; this dashboard is just\nmeant to demonstrate what can be done.\n\n## Running on Linux/Mac\n\nThe docker-compose file will mount the Chia log from\n`$HOME/.chia/mainnet/log/debug.log`, verify that this location is correct and\nset the log level to INFO in the Chia configuration (usually at\n`$HOME/.chia/mainnet/config/config.yaml`).\n\nRun:\n\n    docker-compose up -d\n\nThis will do the following:\n\n* Build container image with configuration for mtail from source\n* Build container image for chia_exporter from source\n* Download other images from docker hub\n* Run containers in the background, attached to the host network (this makes it\n  easy to communicate with native services, but has some trade-offs. See notes.)\n\nThe grafana service provisions the prometheus and loki datasources and a basic\ndashboard that displays harvester and node metrics.\n\nAccess Grafana at http://localhost:3000 and login with the default admin/admin\nusername and password (you'll be prompted to change the password).\n\n### Notes\n\n* It's highly encouraged to run the node exporter natively rather than in\n  docker - see the discussion in the [node_exporter\n  docs](https://github.com/prometheus/node_exporter#docker). On Ubuntu you can \n  run `sudo apt install prometheus-node-exporter`, which includes disk SMART \n  monitoring (disk temperatures, etc) as well. If you do run it in\n  Docker, you'll need to bind-mount in any other volumes you want to monitor\n  (add them to the `volumes` list in `docker-compose.yml`, e.g. `-\n  '/scratch:/scratch'`). See [issue #3](https://github.com/retzkek/chiamon/issues/3).\n\n* The docker-compose file uses the `$HOME` environment variable for the Chia log\n  paths. Verify that these paths are correct, and if you run the\n  `docker-compose` commands with `sudo` then you'll have to replace `$HOME`\n  with the actual path (since root's home is not your home!). Even better, add\n  your user to the `docker` group so you don't have to use `sudo`:\n\n        sudo usermod -a -G docker username\n\n* On **Mac** you'll need to run node_exporter natively, not under Docker: `brew\n  install node_exporter`. You'll probably need to change the networking setup\n  too, since Docker on Mac runs in a VM. See the windows docker-compose and\n  prometheus configs.\n\n## Running on Windows\n\nThe node exporter **does not** work on Windows; instead you need to use the\nWindows exporter for system metrics. Modified config and example dashboard are\nin the [windows branch](https://github.com/retzkek/chiamon/tree/windows). You\nmay also want to review the discussion in [issue\n#2](https://github.com/retzkek/chiamon/issues/2).\n\nThese steps will get you to a working setup (but aren't the only way):\n\n* Install [Docker Desktop](https://www.docker.com/products/docker-desktop)\n* Install [Visual Studio Code](https://code.visualstudio.com/)\n* Install [git](https://git-scm.com/)\n* Install [Windows exporter](https://github.com/prometheus-community/windows_exporter/releases/download/v0.16.0/windows_exporter-0.16.0-386.msi)\n* Clone the chiamon repository with VSCode\n* Modify `docker-compose.yml`:\n    - Change volume paths to point to your home directory.\n* Run services. In VSCode with docker extension you can just right-click on `docker-compose.yml` and select \"Compose Up\"\n* Check target status in Prometheus at http://localhost:9090/targets\n* Access Grafana at http://localhost:3000 (admin/admin).\n\n## Monitoring Multiple Nodes\n\nTo monitor multiple nodes (e.g. multiple harvesters), you just need to run the\nappropriate exporters (e.g. `node_exporter` and `mtail` for a harvester) and add\nthem as targets in the prometheus config, for example:\n\n```yaml\n  - job_name: 'node'\n    static_configs:\n      - targets: ['localhost:9100', 'harvester1:9100', 'harvester2:9100']\n  - job_name: 'mtail'\n    static_configs:\n      - targets: ['localhost:3903', 'harvester1:3903', 'harvester2:3903']\n```\n\nIf you're also running Loki to collect logs, you'll also want to run `promtail`\non every node, and configure it to push logs to Loki on your monitoring node:\n\n```yaml\nclients:\n  - url: http://loki-server:3100/loki/api/v1/push\n```\n\n## Copyright \u0026 License\n\nCopyright 2021 Kevin Retzke\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the Free\nSoftware Foundation, either version 3 of the License, or (at your option) any\nlater version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\ndetails.\n\nSee LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretzkek%2Fchiamon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretzkek%2Fchiamon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretzkek%2Fchiamon/lists"}