{"id":30883419,"url":"https://github.com/globocom/echo-prometheus","last_synced_at":"2025-09-08T09:45:44.589Z","repository":{"id":52988425,"uuid":"210599372","full_name":"globocom/echo-prometheus","owner":"globocom","description":"Middleware for echo v4 to instrument all handlers as metrics","archived":false,"fork":false,"pushed_at":"2023-02-25T02:28:37.000Z","size":49,"stargazers_count":52,"open_issues_count":3,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-06T08:36:36.823Z","etag":null,"topics":["echo","golang","metrics","middleware","prometheus"],"latest_commit_sha":null,"homepage":null,"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-24T12:37:40.000Z","updated_at":"2025-02-11T21:34:45.000Z","dependencies_parsed_at":"2024-06-18T15:28:58.962Z","dependency_job_id":"6c519d43-e486-449d-a0d5-e043d0bcfc26","html_url":"https://github.com/globocom/echo-prometheus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/echo-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fecho-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fecho-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fecho-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fecho-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/echo-prometheus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Fecho-prometheus/sbom","scorecard":{"id":430041,"data":{"date":"2025-08-11","repo":{"name":"github.com/globocom/echo-prometheus","commit":"b0cf42b37f8db896d07aa07c18f1f92709b4cdee"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Code-Review","score":5,"reason":"Found 5/9 approved changesets -- score normalized to 5","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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 'master'"],"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 9 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":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2023-1495 / GHSA-fxg5-wq6x-vr4w","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"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:25.070Z","repository_id":52988425,"created_at":"2025-08-19T03:07:25.070Z","updated_at":"2025-08-19T03:07:25.070Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166947,"owners_count":25233959,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"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":["echo","golang","metrics","middleware","prometheus"],"created_at":"2025-09-08T09:45:39.250Z","updated_at":"2025-09-08T09:45:44.574Z","avatar_url":"https://github.com/globocom.png","language":"Go","readme":"# Echo Prometheus\nMiddleware for echo v4 to instrument all handlers as metrics\n\n\n## Example of usage\n\n### With default config\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/labstack/echo/v4\"\n\t\"github.com/prometheus/client_golang/prometheus/promhttp\"\n\techoPrometheus \"github.com/globocom/echo-prometheus\"\n)\n\nfunc main() {\n\te := echo.New()\n\n\te.Use(echoPrometheus.MetricsMiddleware())\n\te.GET(\"/metrics\", echo.WrapHandler(promhttp.Handler()))\n\n\te.GET(\"/\", func(c echo.Context) error {\n\t\treturn c.String(http.StatusOK, \"Hello, World!\")\n\t})\n\te.Logger.Fatal(e.Start(\":1323\"))\n}\n```\n\n### With custom config\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/labstack/echo/v4\"\n\t\"github.com/prometheus/client_golang/prometheus/promhttp\"\n\techoPrometheus \"github.com/globocom/echo-prometheus\"\n)\n\nfunc main() {\n\te := echo.New()\n\n\tvar configMetrics = echoPrometheus.NewConfig()\n\t\tconfigMetrics.Namespace = \"namespace\"\n\t\tconfigMetrics.Buckets = []float64{\n\t\t\t0.0005, // 0.5ms\n\t\t\t0.001,  // 1ms\n\t\t\t0.005,  // 5ms\n\t\t\t0.01,   // 10ms\n\t\t\t0.05,   // 50ms\n\t\t\t0.1,    // 100ms\n\t\t\t0.5,    // 500ms\n\t\t\t1,      // 1s\n\t\t\t2,      // 2s\n\t}\n\n\te.Use(echoPrometheus.MetricsMiddlewareWithConfig(configMetrics))\n\te.GET(\"/metrics\", echo.WrapHandler(promhttp.Handler()))\n\n\te.GET(\"/\", func(c echo.Context) error {\n\t\treturn c.String(http.StatusOK, \"Hello, World!\")\n\t})\n\te.Logger.Fatal(e.Start(\":1323\"))\n}\n```\n\n### Gzip middleware\n\nA middleware skipper can be passed to avoid gzip `/metrics` URL:\n\n```go\ne.Use(middleware.GzipWithConfig(middleware.GzipConfig{\n  Skipper: func(c echo.Context) bool {\n    return c.Path() == \"/metrics\"\n  },\n}))\n```\n\n## Example output for metric route\n\n```\n# HELP echo_http_request_duration_seconds Spend time by processing a route\n# TYPE echo_http_request_duration_seconds histogram\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.0005\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.001\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.002\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.005\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.01\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.02\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.05\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.1\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.2\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"0.5\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"1\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"2\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"5\"} 7\necho_http_request_duration_seconds_bucket{handler=\"/\",method=\"GET\",le=\"+Inf\"} 7\necho_http_request_duration_seconds_sum{handler=\"/\",method=\"GET\"} 7.645099999999999e-05\necho_http_request_duration_seconds_count{handler=\"/\",method=\"GET\"} 7\n# HELP echo_http_requests_total Number of HTTP operations\n# TYPE echo_http_requests_total counter\necho_http_requests_total{handler=\"/\",method=\"GET\",status=\"2xx\"} 7\n```\n\n### Tests\n\nRun the tests \n\n```\nmake test\n```\n\n### View metrics via Grafana\n\nWe built a grafana dashboard for these metrics, lookup at [https://grafana.com/grafana/dashboards/10913](https://grafana.com/grafana/dashboards/10913).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fecho-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Fecho-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Fecho-prometheus/lists"}