{"id":38304551,"url":"https://github.com/profects/gormetrics","last_synced_at":"2026-01-17T02:26:17.338Z","repository":{"id":45540070,"uuid":"202737590","full_name":"profects/gormetrics","owner":"profects","description":"Prometheus Metrics for GORM","archived":false,"fork":false,"pushed_at":"2024-07-08T12:03:30.000Z","size":42,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T23:47:04.478Z","etag":null,"topics":["database","golang","gorm","metrics","prometheus"],"latest_commit_sha":null,"homepage":"","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/profects.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-16T14:01:30.000Z","updated_at":"2024-07-08T12:03:34.000Z","dependencies_parsed_at":"2024-06-19T05:16:03.358Z","dependency_job_id":"8fbeb483-999d-495f-b2fe-7da7a6f3483b","html_url":"https://github.com/profects/gormetrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/profects/gormetrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profects%2Fgormetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profects%2Fgormetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profects%2Fgormetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profects%2Fgormetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/profects","download_url":"https://codeload.github.com/profects/gormetrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profects%2Fgormetrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"online","status_checked_at":"2026-01-17T02:00:07.808Z","response_time":85,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["database","golang","gorm","metrics","prometheus"],"created_at":"2026-01-17T02:26:17.207Z","updated_at":"2026-01-17T02:26:17.330Z","avatar_url":"https://github.com/profects.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gormetrics\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/profects/gormetrics)](https://goreportcard.com/report/github.com/profects/gormetrics)\n[![GoDoc](https://godoc.org/github.com/profects/gormetrics?status.svg)](http://godoc.org/github.com/profects/gormetrics)\n\nA plugin for GORM providing metrics using Prometheus.\n\nWarning: this plugin is still in an early stage of development. APIs may change.\n\n## Usage\n\n```go\nimport \"github.com/profects/gormetrics\"\n\nerr := gormetrics.Register(db, \u003cdatabase name\u003e)\nif err != nil {\n\t// handle the error\n}\n```\n\ngormetrics does not expose the metrics endpoint using promhttp, you have to do this yourself.\nYou can use the following snippet for exposing metrics on port 2112 at `/metrics`:\n\n```go\ngo func() {\n\thttp.Handle(\"/metrics\", promhttp.Handler())\n\tlog.Fatal(http.ListenAndServe(\":2112\", nil))\n}()\n```\n\n## Exported metrics\n\ngormetrics exports the following metrics (counter vectors):\n* `gormetrics_all_total`\n* `gormetrics_creates_total`\n* `gormetrics_deletes_total`\n* `gormetrics_queries_total`\n* `gormetrics_updates_total`\n\nThese all have the following labels:\n* `database`: the name of the database\n* `driver`: the driver for the database (e.g. pq)\n* `status`: fail or success\n\nIt also export the following metrics (gauge vectors):\n* `gormetrics_connections_idle`\n* `gormetrics_connections_in_use`\n* `gormetrics_connections_open`\n\nThese all have the following labels:\n* `database`: the name of the database\n* `driver`: the driver for the database (e.g. pq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofects%2Fgormetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofects%2Fgormetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofects%2Fgormetrics/lists"}