{"id":18418586,"url":"https://github.com/bsm/omgrpc","last_synced_at":"2025-04-13T05:54:48.925Z","repository":{"id":57624723,"uuid":"392611004","full_name":"bsm/omgrpc","owner":"bsm","description":"OpenMetrics instrumentation for gRPC in Go","archived":false,"fork":false,"pushed_at":"2021-08-19T08:14:39.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T05:54:45.948Z","etag":null,"topics":[],"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/bsm.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":"2021-08-04T08:32:21.000Z","updated_at":"2021-08-19T08:13:57.000Z","dependencies_parsed_at":"2022-08-26T23:10:14.544Z","dependency_job_id":null,"html_url":"https://github.com/bsm/omgrpc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fomgrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fomgrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fomgrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsm%2Fomgrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsm","download_url":"https://codeload.github.com/bsm/omgrpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670502,"owners_count":21142901,"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-11-06T04:14:05.228Z","updated_at":"2025-04-13T05:54:48.903Z","avatar_url":"https://github.com/bsm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# omgrpc - [OpenMetrics](https://github.com/bsm/openmetrics) [gRPC](https://github.com/grpc/grpc-go) middleware\n\n[![Lint](https://github.com/bsm/omgrpc/actions/workflows/lint.yml/badge.svg)](https://github.com/bsm/omgrpc/actions/workflows/lint.yml)\n[![Test](https://github.com/bsm/omgrpc/actions/workflows/test.yml/badge.svg)](https://github.com/bsm/omgrpc/actions/workflows/test.yml)\n\n## Quickstart\n\n```go\nimport (\n  \"github.com/bsm/omgrpc\"\n  \"github.com/bsm/openmetrics\"\n  \"google.golang.org/grpc\"\n)\n\nfunc initGRPCServer(\n  fooServer yourproto.FooServer,\n\n  callCount openmetrics.CounterFamily,      // with tags: \"method\", \"status\"\n  callDuration openmetrics.HistogramFamily, // with tags: \"method\", \"status\"\n  activeConns openmetrics.GaugeFamily,      // no tags\n) *grpc.Server {\n  server := grpc.NewServer(\n    grpc.WithStats(omgrpc.InstrumentCallCount(callCount)),\n    grpc.WithStats(omgrpc.InstrumentCallDuration(callDuration)),\n    grpc.WithStats(omgrpc.InstrumentActiveConns(activeConns)),\n  )\n  yourproto.RegisterFooServer(server, fooServer)\n  return server\n}\n\nfunc initGRPCClient(\n  ctx context.Context,\n  target string,\n\n  callCount openmetrics.CounterFamily,      // with tags: \"method\", \"status\"\n  callDuration openmetrics.HistogramFamily, // with tags: \"method\", \"status\"\n  activeConns openmetrics.GaugeFamily,      // no tags\n) (*grpc.Conn, error) {\n  return grpc.DialContext(\n    ctx,\n    target,\n\n    grpc.WithStatsHandler(omgrpc.InstrumentCallCount(callCount)),\n    grpc.WithStatsHandler(omgrpc.InstrumentCallDuration(callDuration)),\n    grpc.WithStatsHandler(omgrpc.InstrumentActiveConns(activeConns)),\n  )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsm%2Fomgrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsm%2Fomgrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsm%2Fomgrpc/lists"}