{"id":22654241,"url":"https://github.com/stevencyb/mget","last_synced_at":"2025-08-06T08:32:10.513Z","repository":{"id":42615293,"uuid":"510883536","full_name":"StevenCyb/mget","owner":"StevenCyb","description":"Simple client to request, parse and filter metrics.","archived":false,"fork":false,"pushed_at":"2023-01-28T00:48:45.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-03-09T08:20:53.360Z","etag":null,"topics":[],"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/StevenCyb.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":"2022-07-05T20:23:11.000Z","updated_at":"2022-07-05T20:51:03.000Z","dependencies_parsed_at":"2023-02-15T13:45:38.851Z","dependency_job_id":null,"html_url":"https://github.com/StevenCyb/mget","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenCyb%2Fmget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenCyb%2Fmget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenCyb%2Fmget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenCyb%2Fmget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StevenCyb","download_url":"https://codeload.github.com/StevenCyb/mget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228867117,"owners_count":17983879,"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":[],"created_at":"2024-12-09T09:36:00.478Z","updated_at":"2024-12-09T09:36:01.049Z","avatar_url":"https://github.com/StevenCyb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mget\n![GitHub](https://img.shields.io/github/license/StevenCyb/mget)\n\nSimple client to request, parse and filter metrics from api endpoint.\nThis package is not production ready and will probably not be developed further.\n\n## Just request metrics\n```golang\nendpoint := \"https://somewhere.com/metrics\"\nresult := mget.NewClient().Endpoint(endpoint).Do(context.Background())\n\n/*\n * When the endpoint returns the following metrics:\n *    # HELP go_gc_duration_seconds A summary of the pause duration.\n *    # TYPE go_gc_duration_seconds summary\n *    go_gc_duration_seconds{quantile=\"0\"} 3.275e-05\n *    go_gc_duration_seconds{quantile=\"0.5\"} 0.000126252\n *    go_gc_duration_seconds{quantile=\"1\"} 0.096255362\n *    go_gc_duration_seconds_count 7971\n *    # HELP go_goroutines Number of goroutines that currently exist.\n *    # TYPE go_goroutines gauge\n *    go_goroutines 86\n *    # HELP go_info Information about the Go environment.\n *    # TYPE go_info gauge\n *    go_info{version=\"go1.17.2\"} 1\n * \n * Then the result would look like:\n *    {\n  *     \"ResponseStatus\":200,\n  *     \"Err\":null,\n  *     \"Metric\":[\n  *         {\n  *           \"Name\":\"go_gc_duration_seconds\",\n  *           \"Help\":\"A summary of the pause duration.\",\n  *           \"Type\":\"SUMMARY\",\n  *           \"TypeRaw\":\"summary\",\n  *           \"Values\":[\n  *               { \"Label\":{\"quantile\":\"0\"}, \"Value\":0.00003275},\n  *               { \"Label\":{\"quantile\":\"0.5\"}, \"Value\":0.000126252},\n  *               { \"Label\":{\"quantile\":\"1\"}, \"Value\":0.096255362}\n  *           ]\n  *         },\n  *         {\n  *           \"Name\":\"go_gc_duration_seconds_count\",\n  *           \"Help\":\"\",\n  *           \"Type\":\"UNKNOWN\",\n  *           \"TypeRaw\":\"\",\n  *           \"Values\":[\n  *               { \"Label\":{}, \"Value\":7971}\n  *           ]\n  *         },\n  *         {\n  *           \"Name\":\"go_goroutines\",\n  *           \"Help\":\"Number of goroutines that currently exist.\",\n  *           \"Type\":\"GAUGE\",\n  *           \"TypeRaw\":\"gauge\",\n  *           \"Values\":[\n  *               { \"Label\":{}, \"Value\":86}\n  *           ]\n  *         },\n  *         {\n  *           \"Name\":\"go_info\",\n  *           \"Help\":\"Information about the Go environment.\",\n  *           \"Type\":\"GAUGE\",\n  *           \"TypeRaw\":\"gauge\",\n  *           \"Values\":[\n  *               { \"Label\":{\"version\":\"go1.17.2\"}, \"Value\":1}\n  *           ]\n  *         },\n  *     ]\n  *   }\n */\n```\n\n## Filter \n### By name\n```golang\nresult := mget.NewClient().\n\tEndpoint(endpoint).\n\tFilterByName(\"go_gc_duration_seconds_count\", \"go_goroutines\").\n\tDo(context.Background())\n```\n### By metric type\n```golang\nresult := mget.NewClient().\n\tEndpoint(endpoint).\n\tFilterByType(mget.SummaryType).\n\tDo(context.Background())\n```\n### By metric labels\n```golang\nresult := mget.NewClient().\n\tEndpoint(endpoint).\n\tFilterByLabel(map[string][]string{\n\t\t\"service_name\":    {\"service_a\", \"service_b\", \"service_c\"},\n\t\t\"boundary\": {\"backend\"},\n\t}).\n\tDo(context.Background())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevencyb%2Fmget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevencyb%2Fmget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevencyb%2Fmget/lists"}