grpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: ISC Imports: 14 Imported by: 0

README

Go Doc

gRPC Telemetry

This package can be used for building observable gRPC servers and clients. It uses interceptors to intercept gRPC handlers and calls to report logs, metrics, and traces out-of-the-box.

Quick Start

You can find basic examples here.

Documentation

Overview

Package grpc is used for building observable gRPC servers and clients that automatically report logs, metrics, and traces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerStreamWithContext

func ServerStreamWithContext(ctx context.Context, s grpc.ServerStream) grpc.ServerStream

ServerStreamWithContext returns a new grpc.ServerStream with a new context.

Types

type ClientInterceptor

type ClientInterceptor struct {
	// contains filtered or unexported fields
}

ClientInterceptor is used for creating interceptors with logging, metrics, and tracing for grpc clients.

func NewClientInterceptor

func NewClientInterceptor(probe telemetry.Probe, opts Options) *ClientInterceptor

NewClientInterceptor creates a new observable client interceptor.

func (*ClientInterceptor) DialOptions

func (i *ClientInterceptor) DialOptions() []grpc.DialOption

DialOptions return grpc dial options for unary and stream interceptors. This can be used for making gRPC method calls observable via logging, metrics, tracing, etc.

type Options

type Options struct {
	ExcludedMethods []string
}

Options are optional configurations for interceptors.

type ServerInterceptor

type ServerInterceptor struct {
	// contains filtered or unexported fields
}

ServerInterceptor creates interceptors with logging, metrics, and tracing for grpc servers.

func NewServerInterceptor

func NewServerInterceptor(probe telemetry.Probe, opts Options) *ServerInterceptor

NewServerInterceptor creates a new observable server interceptor.

func (*ServerInterceptor) ServerOptions

func (i *ServerInterceptor) ServerOptions() []grpc.ServerOption

ServerOptions return grpc server options for unary and stream interceptors. This can be used for making gRPC method handlers observable via logging, metrics, tracing, etc. It also observes and recovers panics that happened inside the method handlers.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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