{"id":30883441,"url":"https://github.com/globocom/go-redis-prometheus","last_synced_at":"2026-03-13T16:33:07.151Z","repository":{"id":54504261,"uuid":"308152066","full_name":"globocom/go-redis-prometheus","owner":"globocom","description":"go-redis hook to export Prometheus metrics","archived":false,"fork":false,"pushed_at":"2020-11-27T14:12:40.000Z","size":39,"stargazers_count":22,"open_issues_count":2,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-09-08T09:49:46.944Z","etag":null,"topics":["go","go-redis","golang","prometheus","redis"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/globocom.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":"2020-10-28T22:05:52.000Z","updated_at":"2025-08-19T20:51:16.000Z","dependencies_parsed_at":"2022-08-13T18:00:57.268Z","dependency_job_id":null,"html_url":"https://github.com/globocom/go-redis-prometheus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/go-redis-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-redis-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-redis-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-redis-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-redis-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/go-redis-prometheus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fgo-redis-prometheus/sbom","scorecard":{"id":430057,"data":{"date":"2025-08-11","repo":{"name":"github.com/globocom/go-redis-prometheus","commit":"e611617daeb47e3d0e9c5f22fc41f0bae646f1f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 3/16 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/globocom/go-redis-prometheus/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/globocom/go-redis-prometheus/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0322 / GHSA-cg3q-j54f-5p7p"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:07:35.220Z","repository_id":54504261,"created_at":"2025-08-19T03:07:35.221Z","updated_at":"2025-08-19T03:07:35.221Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30471082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"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":["go","go-redis","golang","prometheus","redis"],"created_at":"2025-09-08T09:45:50.522Z","updated_at":"2026-03-13T16:33:07.045Z","avatar_url":"https://github.com/globocom.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-redis-prometheus\n\n\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/github/workflow/status/globocom/go-redis-prometheus/Go?style=flat-square\"\u003e\n  \u003ca href=\"https://github.com/globocom/go-redis-prometheus/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/globocom/go-buffer?color=blue\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/go-mod/go-version/globocom/go-redis-prometheus?style=flat-square\"\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/globocom/go-redis-prometheus\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Go-reference-blue?style=flat-square\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[go-redis](https://github.com/go-redis/redis) hook that exports Prometheus metrics.\n\nAlso check out our lib https://github.com/globocom/go-redis-opentracing.\n\n## Installation\n\n    go get github.com/globocom/go-redis-prometheus\n\n## Usage\n\n```golang\npackage main\n\nimport (\n    \"github.com/go-redis/redis/v8\"\n    \"github.com/globocom/go-redis-prometheus\"\n)\n\nfunc main() {\n    hook := redisprom.NewHook(\n        redisprom.WithInstanceName(\"cache\"),\n        redisprom.WithNamespace(\"my_namespace\"),\n        redisprom.WithDurationBuckets([]float64{.001, .005, .01}),\n    )\n\n    client := redis.NewClient(\u0026redis.Options{\n        Addr:     \"localhost:6379\",\n        Password: \"\",\n    })\n    client.AddHook(hook)\n\n    // run redis commands...\n}\n```\n\n## Exported metrics\n\nThe hook exports the following metrics:\n\n- Single commands (not pipelined):\n  - Histogram of commands: `redis_single_commands_bucket{instance=\"main\",command=\"get\"}`\n  - Counter of errors: `redis_single_errors{instance=\"main\",command=\"get\"}`\n - Pipelined commands:\n   - Counter of commands: `redis_pipelined_commands{instance=\"main\",command=\"get\"}`\n   - Counter of errors: `redis_pipelined_errors{instance=\"main\",command=\"get\"}`\n\n## Note on pipelines\n\nIt isn't possible to measure the duration of individual\npipelined commands, but the duration of the pipeline itself is calculated and\nexported as a pseudo-command called \"pipeline\" under the single command metric.\n\n## API stability\n\nThe API is unstable at this point and it might change before `v1.0.0` is released.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fgo-redis-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Fgo-redis-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fgo-redis-prometheus/lists"}