{"id":19121185,"url":"https://github.com/maticnetwork/node-prometheus","last_synced_at":"2025-05-05T16:25:56.223Z","repository":{"id":50756670,"uuid":"253535783","full_name":"maticnetwork/node-prometheus","owner":"maticnetwork","description":"Validator node monitoring scripts","archived":false,"fork":false,"pushed_at":"2023-10-26T11:47:48.000Z","size":47,"stargazers_count":9,"open_issues_count":4,"forks_count":18,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-19T10:28:11.446Z","etag":null,"topics":["grafana","monitoring","prometheus"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maticnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-06T15:16:37.000Z","updated_at":"2024-10-30T21:28:00.000Z","dependencies_parsed_at":"2025-04-19T02:32:44.827Z","dependency_job_id":"e17c6d5d-dde7-49bf-84d6-305e7981d0e4","html_url":"https://github.com/maticnetwork/node-prometheus","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/maticnetwork%2Fnode-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maticnetwork%2Fnode-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maticnetwork","download_url":"https://codeload.github.com/maticnetwork/node-prometheus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252532828,"owners_count":21763477,"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":["grafana","monitoring","prometheus"],"created_at":"2024-11-09T05:16:21.362Z","updated_at":"2025-05-05T16:25:56.187Z","avatar_url":"https://github.com/maticnetwork.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Matic node Monitoring\n\nMonitor your Heimdall, Bor and Virtual machine node with Prometheus and Grafana\n\n## Follow below steps to set up monitoring for you Matic Node\n\n**Pre-Requesite**: You need to make sure that you Matic Node is setup, including Heimdall and Bor nodes. \n\n**Step 1:**\n\nBy default these changes should have already been made as part of your node setup but incase they're not, you can follow the steps below\n\nYou will need to change `prometheus` flag to `true` in the `config.toml`. \n\nTo access the config.toml here:\n\n`vi ~/.heimdalld/config/config.toml`\n\nMake sure that you keep the formatting intact.\n\n**Step 2:**\n\nOnce you have made the changes in the `config.toml` you will need to stop Heimdall service and restart it. Note that you only need to restart Heimdall service if you have made changes to it.\n\nTo stop heimdall service:\n\n`sudo service heimdalld stop`\n\nTo restart heimdall service:\n\n`sudo service heimdalld start`\n\n**Step 3:**\n\nYou will make changes in the Bor service file. To access the `bor.service` file you can run this command:\n\n`nano /home/ubuntu/node/bor/start.sh`\n\nThere would be multiple entries. By default the following parameters should be automatically added, but if they're not added then you can the parameters from below.\n\nNow in this you would see multiple paramaters in a list format. Add this in the following format. You can add it anywhere, for example, you can add it after `--maxpeers 150`\n\n```js\n--metrics \\\n--pprof --pprofport 7071 --pprofaddr '0.0.0.0' \\\n``` \n\nNote that these parameters should already be added as part of your setup. You only need to add these parameters if they're not already present in the `start.sh` file. \n\nYou need to make sure that the spaces and formatting are intact.\n\nNow you will notice that your bor will stop because we made changes to the service file. You will need to stop the bor service and restart it.\n\nTo Stop Bor service:\n\n`sudo service bor stop`\n\nNote: When you stop the service of Bor you may encounter a warning asking you run `systemctl daemon-reload` to reload units.\n\nYou will need to run this as `sudo systemctl daemon-reload`. Once this is successfull you can proceed with starting the Bor service.\n\nTo Restart Bor service:\n\n`sudo service bor start`\n\n\n**Step 4:**\n\nClone the Prometheus repository to your remote machine\n\n`git clone https://github.com/maticnetwork/node-prometheus.git`\n\nAnd then switch to the Prometheus directory.\n\nThen install Docker by running the following command:\n\n`sudo apt install docker-compose`\n\nOnce Docker is installed then you run docker by running the following command to start Prometheus: `sudo docker-compose up -d`\n\nNote: If you're getting an error after running `docker-compose up -d` please run the following commands on your remote machine\n\n`sudo usermod -aG docker ubuntu`\n\n`newgrp docker`\n\nAnd then you can run `docker-compose up -d` again.\n\n**Step 5:**\n\nOpen Grafana at following URL:\n\n```\nhttp://host_ip:3000\n```\n\n**Note**: Ports of 3000 and 9090 need to open on your cloud firewall.\n\n**Creating a Proxy Tunnel**\n\n**This is an optional step.**\n\nIf you're running your Node on a Cloud service then you can also create a proxy tunnel on your local machine to your Cloud Machine\n\nYou can run this command `ssh -N -L 3000:0.0.0.0:3000 ubuntu@\u003cyour ip address\u003e`. There would not be any output for this, however you can then check in your browser and access this URL: \u003cyour ip address\u003e:3000\n\nYou should be able to login to Grafana dashboard. Else you can always use http://localhost:3000\n\n## Grafana default login details\n\nThese login credentials can be changed according to user preferences once logged in:\n\n```\nusername: admin\npassword: admin\n```\n\n## Grafana datasource configuration and navigation snapshots\n\nGrafana uses web based APIs to connect to prometheus server for indexed data. For that, it needs prometheus host name.\n\n\n1. Open grafana at url: http://host_ip:3000. Hover on the setting icon in the left pane and selet Data Sources:\n\n\n\n    ![Screenshot 2020-04-03 at 4 49 47 PM](https://user-images.githubusercontent.com/31979627/78356085-8bf3a480-75cc-11ea-9ed0-635edd495c96.png)\n\n\n2. Notice that Prometheus sample datasource is added and click on the same:\n\n\n     ![Screenshot 2020-04-03 at 4 50 14 PM](https://user-images.githubusercontent.com/31979627/78356289-e856c400-75cc-11ea-86da-e94d742a07f7.png)\n\n\n3. Change the HTTP url to http://host_ip:9090 and save. Make sure `9090` port is open. Click on `Save and Test` button to chek if the connection is a success. After the success message, go to Grafana home:\n\n\n     ![Screenshot 2020-04-03 at 5 14 53 PM](https://user-images.githubusercontent.com/31979627/78357564-4dabb480-75cf-11ea-9c9c-f6e8daadec47.png)\n\n\n4. Click on the Home button on the left top and select the required option (Heimdall-Dashboard/Bor-Dashboard/Node-Dashboard) to view the respective metrics.\n\n\n     ![Screenshot 2020-04-03 at 5 39 36 PM](https://user-images.githubusercontent.com/31979627/78359766-543c2b00-75d3-11ea-8b62-d8e8ee422191.png)\n\n5. Notice Heimdall-Dashboard loaded as below\n\n     ![Screenshot 2020-04-03 at 5 46 49 PM](https://user-images.githubusercontent.com/31979627/78359855-78980780-75d3-11ea-8cdf-8db0cb5ac4cc.png)\n\n6. Notice Bor-Dashboard loaded as below\n     \n     ![Screenshot 2020-04-07 at 1 23 47 PM](https://user-images.githubusercontent.com/31979627/78644246-33c1e880-78d3-11ea-9073-afe8077ab917.png)\n     \n7. Notice Node-Dashboard loaded as below\n\n     ![Screenshot 2020-04-07 at 1 23 18 PM](https://user-images.githubusercontent.com/31979627/78644461-89969080-78d3-11ea-9123-8587653c9d9a.png)\n     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaticnetwork%2Fnode-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaticnetwork%2Fnode-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaticnetwork%2Fnode-prometheus/lists"}