iongrpc

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package grpc provides gRPC server and client instrumentation using OpenTelemetry.

Server instrumentation using stats handler:

server := grpc.NewServer(
    grpc.StatsHandler(iongrpc.ServerHandler()),
)

Client instrumentation using stats handler:

conn, err := grpc.Dial(addr,
    grpc.WithStatsHandler(iongrpc.ClientHandler()),
)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientHandler

func ClientHandler(opts ...Option) stats.Handler

ClientHandler returns a stats.Handler for gRPC client instrumentation. Use with grpc.WithStatsHandler() option when dialing.

Example:

conn, err := grpc.Dial(addr,
    grpc.WithStatsHandler(iongrpc.ClientHandler()),
)

func ServerHandler

func ServerHandler(opts ...Option) stats.Handler

ServerHandler returns a stats.Handler for gRPC server instrumentation. Use with grpc.StatsHandler() option when creating a gRPC server.

Example:

server := grpc.NewServer(
    grpc.StatsHandler(iongrpc.ServerHandler()),
)

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures gRPC instrumentation.

func WithFilter

func WithFilter(filter otelgrpc.InterceptorFilter) Option

WithFilter sets a filter function to exclude methods from tracing. Return false to skip tracing for the given request.

Example:

iongrpc.ServerHandler(iongrpc.WithFilter(func(info *otelgrpc.InterceptorInfo) bool {
    return info.Method != "/grpc.health.v1.Health/Check"
}))

Jump to

Keyboard shortcuts

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