telemetry

package
v0.0.0-...-ed6b86b Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient *client

Functions

func Init

func Init(config Config)

Types

type Config

type Config struct {
	DNS            string `yaml:"dns" json:"dns"`
	ServiceName    string `yaml:"serviceName" json:"serviceName" default:"unset"`
	ServiceVersion string `yaml:"serviceVersion" json:"serviceVersion" default:"v1.0.0"`
	DeploymentEnv  string `yaml:"deploymentEnv" json:"deploymentEnv" default:"prod"`
}

type Content

type Content struct {
	Attrs  []attribute.KeyValue
	Failed error
}

type HttpClientHook

type HttpClientHook struct {
}

func NewHttpClientHook

func NewHttpClientHook() *HttpClientHook

func (*HttpClientHook) AfterRequest

func (h *HttpClientHook) AfterRequest(ctx context.Context, _ *http.Request, response *http.Response, err error) error

func (*HttpClientHook) BeforeRequest

func (h *HttpClientHook) BeforeRequest(ctx context.Context, request *http.Request) (context.Context, error)

type Option

type Option func(h *QueryHook)

func WithAttributes

func WithAttributes(attrs ...attribute.KeyValue) Option

WithAttributes configures attributes that are used to create a span.

func WithDBName

func WithDBName(name string) Option

WithDBName configures a db.name attribute.

func WithFormattedQueries

func WithFormattedQueries(format bool) Option

WithFormattedQueries enables formatting of the query that is added as the statement attribute to the trace. This means that all placeholders and arguments will be filled first and the query will contain all information as sent to the database.

func WithMeterProvider

func WithMeterProvider(mp metric.MeterProvider) Option

WithMeterProvider returns an Option to use the MeterProvider when creating a Meter.

func WithSpanNameFormatter

func WithSpanNameFormatter(f func(*bun.QueryEvent) string) Option

WithSpanNameFormatter takes a function that determines the span name for a given query event.

func WithTracerProvider

func WithTracerProvider(tp trace.TracerProvider) Option

WithTracerProvider returns an Option to use the TracerProvider when creating a Tracer.

type QueryHook

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

func NewQueryHook

func NewQueryHook(opts ...Option) *QueryHook

func (*QueryHook) AfterQuery

func (h *QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)

func (*QueryHook) BeforeQuery

func (h *QueryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context

type TracingHook

type TracingHook struct{}

func NewTracingHook

func NewTracingHook() *TracingHook

func (TracingHook) AfterProcess

func (TracingHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error

func (TracingHook) AfterProcessPipeline

func (TracingHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error

func (TracingHook) BeforeProcess

func (TracingHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)

func (TracingHook) BeforeProcessPipeline

func (TracingHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)

type WebInterceptor

type WebInterceptor struct {
}

func NewWebInterceptor

func NewWebInterceptor() *WebInterceptor

func (*WebInterceptor) After

func (wi *WebInterceptor) After(ctx *app.Context, err e.ApiError) e.ApiError

func (*WebInterceptor) Before

func (wi *WebInterceptor) Before(ctx *app.Context) e.ApiError

func (*WebInterceptor) OnPanic

func (wi *WebInterceptor) OnPanic(ctx *app.Context, recover interface{}) e.ApiError

Jump to

Keyboard shortcuts

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