{"id":17227422,"url":"https://github.com/plutov/gosd","last_synced_at":"2025-03-25T17:49:55.956Z","repository":{"id":57589392,"uuid":"164880384","full_name":"plutov/gosd","owner":"plutov","description":"Go Runtime stats exporter into Stackdriver","archived":false,"fork":false,"pushed_at":"2019-01-09T17:02:54.000Z","size":174,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T15:45:01.896Z","etag":null,"topics":["go","stackdriver"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/plutov.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":"2019-01-09T14:42:20.000Z","updated_at":"2019-01-09T18:32:21.000Z","dependencies_parsed_at":"2022-08-29T23:20:40.194Z","dependency_job_id":null,"html_url":"https://github.com/plutov/gosd","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plutov%2Fgosd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plutov%2Fgosd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plutov%2Fgosd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plutov%2Fgosd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plutov","download_url":"https://codeload.github.com/plutov/gosd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245515941,"owners_count":20628201,"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","stackdriver"],"created_at":"2024-10-15T04:19:14.184Z","updated_at":"2025-03-25T17:49:55.936Z","avatar_url":"https://github.com/plutov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gosd\n\n**gosd** is a Go Runtime stats exporter into Stackdriver.\n\n**gosd** can monitor these stats to better understand the overall health and performance of Go programs.\n\n## Monitored Stats\n\n- [runtime.NumGoroutine](https://golang.org/pkg/runtime/debug/#Stack)\n- [runtime.NumCgoCall](https://golang.org/pkg/runtime/#NumCgoCall)\n- [runtime.ReadMemStats](https://golang.org/pkg/runtime/#ReadMemStats)\n\n## Setting up authentication\n\nTo run the library, you must first set up authentication by creating a service account and setting an environment variable.\n\n[Create service account](https://console.cloud.google.com/apis/credentials/serviceaccountkey) with write acccess for Monitoring, download the key and set this environment variable:\n\n\n```bash\nexport GOOGLE_APPLICATION_CREDENTIALS=\"[PATH]\"\n```\n\nNote: you may skip this step if you are running your Go application on GCP and it has access to Stackdriver Monitoring API.\n\n## Usage\n\n```go\nimport \"github.com/plutov/gosd\"\n\nfunc main() {\n\t// This goroutine will send stats on your behalf\n\tgo gosd.Run(gosd.Config{\n\t\tProjectID: \"PROJECT_ID\",\n\t\tLogger:    os.Stdout,\n\t\tLabels:    map[string]string{\"app\": \"my-web-app\"},\n\t})\n}\n```\n\n### Stackdriver Metrics\n\nIn Stackdriver go to Resources -\u003e Metrics Explorer and find these metrics:\n\n- custom.googleapis.com/gosd/goroutines\n- custom.googleapis.com/gosd/cgocalls\n- custom.googleapis.com/gosd/mstats/*\n\n### Memory Consumption\n\n**gosd** adds around 5Mi to your program memory usage.\n\n### Stackdriver Dashboard\n\n![dashboard.png](https://raw.githubusercontent.com/plutov/gosd/master/dashboard.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplutov%2Fgosd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplutov%2Fgosd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplutov%2Fgosd/lists"}