Top 0.9% dependent packages on proxy.golang.org
Top 1.3% dependent repos on proxy.golang.org
Top 1.7% forks on proxy.golang.org
Top 1.1% docker downloads on proxy.golang.org
proxy.golang.org : github.com/newrelic/go-agent/v3/integrations/nrgrpc
Package nrgrpc instruments https://github.com/grpc/grpc-go. This package can be used to instrument gRPC servers and gRPC clients. To instrument a gRPC server, use UnaryServerInterceptor and StreamServerInterceptor with your newrelic.Application to create server interceptors to pass to grpc.NewServer. The results of these calls are reported as errors or as informational messages (of levels OK, Info, Warning, or Error) based on the gRPC status code they return. In the simplest case, simply add interceptors as in the following example: The disposition of each, in terms of how to report each of the various gRPC status codes, is determined by a built-in set of defaults: These may be overridden on a case-by-case basis using `WithStatusHandler()` options to each `UnaryServerInterceptor()` or `StreamServerInterceptor()` call, or globally via the `Configure()` function. For example, to report DeadlineExceeded as an error and NotFound as a warning, for the UnaryInterceptor only: If you wanted to make those two changes to the overall default behavior, so they apply to all subsequently declared interceptors: In this case the new behavior for those two status codes applies to both interceptors. These interceptors create transactions for inbound calls. The transaction is added to the call context and can be accessed in your method handlers using newrelic.FromContext. Full server example: https://github.com/newrelic/go-agent/blob/master/v3/integrations/nrgrpc/example/server/server.go To instrument a gRPC client, follow these two steps: 1. Use UnaryClientInterceptor and StreamClientInterceptor when creating a grpc.ClientConn. Example: 2. Ensure that calls made with this grpc.ClientConn are done with a context which contains a newrelic.Transaction. Full client example: https://github.com/newrelic/go-agent/blob/master/v3/integrations/nrgrpc/example/client/client.go
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/newrelic/go-agent/v3/integrations/nrgrpc
License: Apache-2.0
Latest release: 4 months ago
First release: over 5 years ago
Namespace: github.com/newrelic/go-agent/v3/integrations
Dependent packages: 39
Dependent repositories: 18
Stars: 692 on GitHub
Forks: 280 on GitHub
Docker dependents: 25
Docker downloads: 25,958
See more repository details: repos.ecosyste.ms
Last synced: about 21 hours ago