grpc

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package grpc provides gRPC instrumentation for metry: server and client stats handlers that create spans and propagate trace context. Use after metry.Init.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientDialOption

func ClientDialOption() grpc.DialOption

ClientDialOption returns a gRPC DialOption that installs the OTel stats handler for the client. Use with grpc.NewClient(addr, metrygrpc.ClientDialOption(), ...).

func ClientStatsHandler

func ClientStatsHandler() stats.Handler

ClientStatsHandler returns a gRPC stats.Handler for client-side tracing and propagation. Use with grpc.NewClient(addr, grpc.WithStatsHandler(metrygrpc.ClientStatsHandler()), ...). Covers both unary and streaming RPCs.

func ServerOptions

func ServerOptions() []grpc.ServerOption

ServerOptions returns gRPC server options that install the OTel stats handler. Use with grpc.NewServer(metrygrpc.ServerOptions()...).

func ServerStatsHandler

func ServerStatsHandler() stats.Handler

ServerStatsHandler returns a gRPC stats.Handler for server-side tracing and metrics. Use with grpc.NewServer(grpc.StatsHandler(metrygrpc.ServerStatsHandler())). Covers both unary and streaming RPCs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL