{"id":17834726,"url":"https://github.com/mcrowson/prometheus_grafana","last_synced_at":"2026-01-17T22:16:02.872Z","repository":{"id":85889780,"uuid":"117105466","full_name":"mcrowson/prometheus_grafana","owner":"mcrowson","description":"Server Monitoring Stack for EC2 Using Prometheus and Grafana","archived":false,"fork":false,"pushed_at":"2018-01-11T13:41:14.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T12:49:29.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mcrowson.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}},"created_at":"2018-01-11T13:41:00.000Z","updated_at":"2018-01-11T13:41:00.000Z","dependencies_parsed_at":"2023-03-13T07:19:52.896Z","dependency_job_id":null,"html_url":"https://github.com/mcrowson/prometheus_grafana","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mcrowson/prometheus_grafana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcrowson%2Fprometheus_grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcrowson%2Fprometheus_grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcrowson%2Fprometheus_grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcrowson%2Fprometheus_grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcrowson","download_url":"https://codeload.github.com/mcrowson/prometheus_grafana/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcrowson%2Fprometheus_grafana/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28519880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-27T20:10:01.011Z","updated_at":"2026-01-17T22:16:02.856Z","avatar_url":"https://github.com/mcrowson.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus Stack\n\nThis is a simple server monitoring stack using prometheus and Grafana for\nservers hosted on AWS EC2.\n\n## Components\nThere are several pieces that make the server monitoring work. They are outlined\nbelow.\n\n### Node Exporter\nThe prometheus stack follows the pull model where prometheus pulls the server\nmetrics from the servers it cares about looking at. Prometheus is currently\nsetup to look at all EC2 servers and gets the list of servers dynamically\nfrom AWS. The node exporter should not be accessible from the internet.\n\nEach box runs a small web-app called a Node Exporter that has the data for\nPrometheus. Each box that is able should run the node exporter through a docker\ncontainer. Here is the code to run the Node Exporter on a box with docker.\n\n```bash\ndocker run --restart always --name node-exporter -d -p 9100:9100 -v \"/proc:/host/proc\" -v \"/sys:/host/sys\" -v \"/:/rootfs\" --net=\"host\" prom/node-exporter --path.procfs /host/proc --path.sysfs /host/proc --collector.filesystem.ignored-mount-points \"^/(sys|proc|dev|host|etc)($|/)\"\n```\n\nThe Node Monitor exposes these stats on port 9100, an example can be seen here:\nhttp://internal.ip:9100/metrics\n\n### Prometheus\nPrometheus then visits each of these target Node Monitors and scrapes its status\nevery 5 seconds. You can see the list of targets on Prometheus here : http://internal.ip:9090/consoles/node.html\nThe prometheus service should not be accessible from the internet.\n\nThe data is stored on prometheus as time series data, but it is not easy to\nconsume from a user perspective.\n\nPrometheus is configured in the prometheus/prometheus.yml file. It is setup to\nlook for the node exporter on port 9100 for all boxes on AWS EC2.\n\n### Grafana\nThe third service running is Grafana and its sole role is to display the prometheus\ndata. Unlike the other services, Grafana is publicly exposed to the internet but\nrequires authentication: http://monitor.server.com:3000/\n\nIt is setup to use Prometheus as a data source and we have used a prebuilt\ndashboard to show the server statistics.\n\nThe main dashboard was created using this Grafana template: https://grafana.com/dashboards/405\n\n### Alertmanager\nThe last piece is Alertmanager that is responsible for alerting when alerts are\ntriggered. Currently alertmanager is setup to just notify the #network_operations\nchannel in slack. Alertmanager is configured according to the\nalertmanater/config.yml file.\n\nAlerts are triggered according to the prometheus/alert.rules file. Prometheus then\nsends notifications to the alertmanager service which is responsible for sending\nout the alerts.\n\nPreviously fired alerts can be seen at http://internal.ip:9093/api/v1/alerts\nThe Alertmanager service should not be accessible from the internet.\n\n## More Documentation\nPrometheus: https://prometheus.io/docs/introduction/overview/\n\nGrafana: http://docs.grafana.org/\n\nAlertmanager: https://prometheus.io/docs/alerting/alertmanager/\n\n## Deploying and Updating\nDeploying updates to prometheus/alertmanager configs is manual at this point.\nWe assume that the updating of rules will be seldom and automating the\ndeployments would be overengineering and likely cause more problems than it solves.\n\nThe config files are all reloaded with the SIGHUP command, so a simple restarting\nof the containers will use the updated config and rules files.\n\n```bash\ndocker-compose restart\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcrowson%2Fprometheus_grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcrowson%2Fprometheus_grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcrowson%2Fprometheus_grafana/lists"}