tracer

package
v1.1.72 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAttribute

func BuildAttribute(args ...any) []attribute.KeyValue

func BuildBaggage

func BuildBaggage(args ...any) baggage.Baggage

func ExtractTextMapCarrier

func ExtractTextMapCarrier(spanCtx context.Context) propagation.MapCarrier

func ExtractTextMapCarrierBytes

func ExtractTextMapCarrierBytes(spanCtx context.Context) []byte

func GetKafkaTracingHeadersFromSpanCtx

func GetKafkaTracingHeadersFromSpanCtx(spanCtx context.Context) []kafka.Header

func InjectTextHeaderCarrier

func InjectTextHeaderCarrier(spanCtx context.Context) (propagation.HeaderCarrier, error)

func InjectTextMapCarrier

func InjectTextMapCarrier(spanCtx context.Context) (propagation.MapCarrier, error)

func MetricCount

func MetricCount(ctx context.Context, meter metric.Meter, data ...any)

func MetricLatency

func MetricLatency(ctx context.Context, span trace.Span, meter metric.Meter, data ...any)

func MetricLineCount

func MetricLineCount(ctx context.Context, meter metric.Meter, data ...any)

func NewTracer

func NewTracer(baseConfig *common_utils.BaseConfig) func()

func SetHttpAttributes

func SetHttpAttributes(span trace.Span, r *http.Request)

func StartAndTrace

func StartAndTrace(ctx context.Context, spanName string) (context.Context, trace.Span)

func StartAndTraceHttp

func StartAndTraceHttp(r *http.Request, spanName string) (context.Context, trace.Span)

func StartAndTraceKafkaConsumer

func StartAndTraceKafkaConsumer(ctx context.Context, headers propagation.MapCarrier, spanName string) (context.Context, trace.Span)

func StartAndTracePubsub

func StartAndTracePubsub(ctx context.Context, spanName string, data *pubsub.Message) (context.Context, trace.Span)

func StartAndTraceWithData

func StartAndTraceWithData(ctx context.Context, spanName string, data ...any) (context.Context, trace.Span)

func StartSpan

func StartSpan(ctx context.Context) (context.Context, trace.Span)

func TextMapCarrierFromKafkaMessageHeaders

func TextMapCarrierFromKafkaMessageHeaders(headers []kafka.Header) propagation.MapCarrier

func TextMapCarrierToKafkaMessageHeaders

func TextMapCarrierToKafkaMessageHeaders(textMap propagation.MapCarrier) []kafka.Header

func TraceErr

func TraceErr(ctx context.Context, err error)

func TraceWithErr

func TraceWithErr(ctx context.Context, err error) error

Types

type IPgxTracer

type IPgxTracer interface {
	TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

	TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)
}

type PgxTracer

type PgxTracer struct {
}

func (*PgxTracer) TraceQueryEnd

func (t *PgxTracer) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)

func (*PgxTracer) TraceQueryStart

func (t *PgxTracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

Jump to

Keyboard shortcuts

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