instrument

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventStart    = event.EventStart
	EventEnd      = event.EventEnd
	EventCall     = event.EventCall
	EventReturn   = event.EventReturn
	EventDBCall   = event.EventDBCall
	EventDBReturn = event.EventDBReturn
)

Variables

This section is empty.

Functions

func GRPCStreamClientInterceptor

func GRPCStreamClientInterceptor() grpc.DialOption

func GRPCStreamServerInterceptor

func GRPCStreamServerInterceptor() grpc.ServerOption

functions for GRPC and DB support -- not in demo!

func GRPCUnaryClientInterceptor

func GRPCUnaryClientInterceptor() grpc.DialOption

func GRPCUnaryServerInterceptor

func GRPCUnaryServerInterceptor() grpc.ServerOption

func Init

func Init(target string) func()

func InsertHeader

func InsertHeader(r *http.Request) *http.Request

func Open

func Open(driverName, dataSourceName string) (*sql.DB, error)

func OpenDB

func OpenDB(c driver.Connector) *sql.DB

func Report

func Report(ctx context.Context, e event.Event, metadata ...any) context.Context

func SetInstrumenter

func SetInstrumenter(key Key)

func WrapHTTPClient

func WrapHTTPClient(client *http.Client) *http.Client

func WrapHandler

func WrapHandler(handler http.Handler) http.Handler

func WrapHandlerFunc

func WrapHandlerFunc(handlerFunc http.HandlerFunc) http.HandlerFunc

Types

type Instrumenter

type Instrumenter interface {
	Init() func()
	InsertHeader(r *http.Request) *http.Request
	Report(ctx context.Context, e event.Event, metadata ...any) context.Context
	WrapHandlerFunc(handlerFunc http.HandlerFunc) http.HandlerFunc
	WrapHTTPClient(client *http.Client) *http.Client
	WrapHandler(handler http.Handler) http.Handler
}

type Key

type Key string
const (
	DD      Key = "dd"
	Console Key = "console"
	OTel    Key = "otel"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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