{"id":17047500,"url":"https://github.com/djmgit/go_runtime_grafana","last_synced_at":"2025-04-12T15:31:41.615Z","repository":{"id":45126237,"uuid":"264669017","full_name":"djmgit/go_runtime_grafana","owner":"djmgit","description":"Grafana dashboard for visualising GOLang runtime metrices using Prometheus for DC based GOLang services","archived":false,"fork":false,"pushed_at":"2020-05-24T09:27:50.000Z","size":567,"stargazers_count":22,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T10:11:26.685Z","etag":null,"topics":["go","grafana","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/djmgit.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}},"created_at":"2020-05-17T13:09:51.000Z","updated_at":"2025-01-31T08:02:42.000Z","dependencies_parsed_at":"2022-07-13T16:44:57.429Z","dependency_job_id":null,"html_url":"https://github.com/djmgit/go_runtime_grafana","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/djmgit%2Fgo_runtime_grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djmgit%2Fgo_runtime_grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djmgit%2Fgo_runtime_grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djmgit%2Fgo_runtime_grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/djmgit","download_url":"https://codeload.github.com/djmgit/go_runtime_grafana/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589603,"owners_count":21129644,"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":["go","grafana","prometheus"],"created_at":"2024-10-14T09:49:36.954Z","updated_at":"2025-04-12T15:31:41.038Z","avatar_url":"https://github.com/djmgit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# go_runtime_grafana\n\nThis repository provides a Grafana dashboard, exported as JSON, for monitoring GOLang runtime of applications in a DC based\nsetup where a given application is deployed on a cluster of servers in a given Data center (on prem or cloud). This dashboard\ngroups together servers by the services being run on them, and services by the DC they are being served from.\n\nIt is possible to select one or multiple DC, and one or multiple hosts for a given service to compare metrics cross hosts and\ncross DC.\n\nThis requires runtime metrics to be exported by the application using prometheus client library for GOLang\n\n## Exporting GOLang metrices\n\nGiven below is a simple, tiny code snippet for enabling your application to expose prometheus metrics at ```/metrics```\nendpoint\n\n```\npackage main\n\nimport (\n        \"net/http\"\n        \"github.com/prometheus/client_golang/prometheus/promhttp\"\n)\n\n\nfunc main() {\n\n        http.Handle(\"/metrics/\", promhttp.Handler())\n        http.ListenAndServe(\":8888\", nil)\n}\n\n```\n\nThis will expose Go runtime metrics at ```http://127.0.0.1:8888/metrics```\n\nYou can send custom metrics to. You can find out more about instrumenting your GOLang app with Prometheus at ther\noffician \u003ca href=\"https://prometheus.io/docs/guides/go-application/\" target=\"_blank\"\u003edocumentation\u003c/a\u003e.\n\n## Adding a target in Prometheus \n\nYour target must have 3 labels attached to them. These are as follows\n\n- **dc** - The dc where this service and its hosts are deployed. This is just a nomenclature, you can group your service\n           by cluster, team, or any other nomenclature.\n\n- **service** - Name of the service\n\n- **hostname** - Name of the server or anything that will uniquely identify the server.\n\nExample target configuration:\n\n```\n- job_name: 'mygoapp-1-dc-1'\n    static_configs:\n      - targets: ['127.0.0.1:2112']\n        labels:\n            dc: \"dc1\"\n            hostname: \"my-goapp-1-server-1\"\n            service: \"mygoapp-1\"\n      - targets: ['127.0.0.1:2113']\n        labels:\n            dc: \"dc1\"\n            hostname: \"mygoapp-1-server-2\"\n            service: \"mygoapp-1\"\n- job_name: 'mygoapp-2-dc-1'\n    static_configs:\n      - targets: ['127.0.0.1:2114']\n        labels:\n            dc: \"dc1\"\n            hostname: \"my-goapp-2-server-1\"\n            service: \"mygoapp-2\"\n      - targets: ['127.0.0.1:2114']\n        labels:\n            dc: \"dc1\"\n            hostname: \"mygoapp-2-server-2\"\n            service: \"mygoapp-2\"\n \n```\n\n## Monitored metrices\n\nSome of the runtime metrics this dashboard visualises :\n\n- Process resident memory\n- Process virtual memory\n- Stack memory\n- Heap memory\n- Allocs\n- Open file descriptors\n- Pointer dereference\n- Number of Goroutines\n- Number of OS threads\n- GC time\n\n## How it looks like\n\n\u003ctable\u003e\n        \u003ctr\u003e\n                \u003ctd\u003e\u003cimg src=\"pics/go_pic_1.png\"\u003e\u003c/td\u003e\n                \u003ctd\u003e\u003cimg src=\"pics/go_pic_2.png\"\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n         \u003ctr\u003e\n                \u003ctd\u003e\u003cimg src=\"pics/go_pic_3.png\"\u003e\u003c/td\u003e\n                \u003ctd\u003e\u003cimg src=\"pics/go_pic_5.png\"\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n                \u003ctd\u003e\u003cimg src=\"pics/go_screen_4.png\"\u003e\u003c/td\u003e\n                \u003ctd\u003e\u003cimg src=\"pics/go_screen_6.png\"\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjmgit%2Fgo_runtime_grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjmgit%2Fgo_runtime_grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjmgit%2Fgo_runtime_grafana/lists"}