Documentation
¶
Index ¶
- Constants
- Variables
- func ContextWithLogger(ctx context.Context) context.Context
- func DefaultLogger() logr.Logger
- func Float64Histogram(name string, options ...metric.Float64HistogramOption) metric.Float64Histogram
- func HandlerFunc(fn http.HandlerFunc, startOptions []trace.SpanStartOption, ...) http.HandlerFunc
- func InstrumentAll(ctx context.Context, otlpEndpoint string) (func(context.Context), error)
- func InstrumentLogging(ctx context.Context, otlpEndpoint string) error
- func InstrumentMetrics(ctx context.Context, otlpEndpoint string) (func(context.Context), error)
- func InstrumentTracing(ctx context.Context, otlpEndpoint string) (func(context.Context), error)
- func Int(element Attributable, k string, v int)
- func Int64Counter(name string, options ...metric.Int64CounterOption) metric.Int64Counter
- func LoggerFromContext(ctx context.Context) logr.Logger
- func Must[M any](metric M, err error) M
- func NewHandleFunc(fn http.HandlerFunc, operation string) http.Handler
- func NewHandler(handler http.Handler, operation string) http.Handler
- func NewHandlerMiddleware(next http.Handler) http.Handler
- func NewStdLogSink() *stdLogSink
- func OpenSQL(driverName, dataSourceName string) (*sql.DB, error)
- func SpanFromContext(ctx context.Context) trace.Span
- func TeeSink(sinks ...logr.LogSink) logr.LogSink
- func WantedRequestHeaders(h http.Header, keys ...string) http.Header
- func WithInt(k string, v int) trace.SpanStartEventOption
- func WithSpanKindClient() trace.SpanStartOption
- type Attributable
- type HTTPSpan
- type Logger
- type Meter
- type MeterOption
- type Span
- type SpanStartOption
- type Tracer
- type TracerOption
Constants ¶
View Source
const ( MODULE = "github.com/wwmoraes/anilistarr" NAME = "anilistarr" NAMESPACE = "api" VERSION = "0.1.0-rc.1" )
Variables ¶
View Source
var (
ErrNoEndpoint = errors.New("OTLP endpoint not provided")
)
View Source
var WithDescription = metric.WithDescription
View Source
var WithUnit = metric.WithUnit
Functions ¶
func DefaultLogger ¶
func Float64Histogram ¶ added in v0.2.0
func Float64Histogram(name string, options ...metric.Float64HistogramOption) metric.Float64Histogram
func HandlerFunc ¶
func HandlerFunc(fn http.HandlerFunc, startOptions []trace.SpanStartOption, endOptions []trace.SpanEndOption) http.HandlerFunc
func InstrumentAll ¶
func InstrumentMetrics ¶
func InstrumentTracing ¶
func Int ¶
func Int(element Attributable, k string, v int)
func Int64Counter ¶ added in v0.2.0
func Int64Counter(name string, options ...metric.Int64CounterOption) metric.Int64Counter
func NewHandleFunc ¶
func NewHandleFunc(fn http.HandlerFunc, operation string) http.Handler
func NewStdLogSink ¶
func NewStdLogSink() *stdLogSink
func WithSpanKindClient ¶
func WithSpanKindClient() trace.SpanStartOption
Types ¶
type Attributable ¶
type HTTPSpan ¶
type HTTPSpan interface { Span HTTPStatus(status int) EndWithStatus(status int, options ...trace.SpanEndOption) }
type MeterOption ¶
type MeterOption = metric.MeterOption
type Span ¶
type Span interface { trace.Span EndWith(err error, options ...trace.SpanEndOption) Assert(error) error Int(k string, v int) }
func StartFunction ¶
type SpanStartOption ¶
type SpanStartOption = trace.SpanStartOption
type Tracer ¶
type Tracer interface { StartFunction(ctx context.Context, opts ...SpanStartOption) (context.Context, Span) StartHTTPResponse(req *http.Request, opts ...SpanStartOption) (context.Context, HTTPSpan) // custom span // from trace.Tracer Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span) }
func DefaultTracer ¶
func DefaultTracer() Tracer
type TracerOption ¶
type TracerOption = trace.TracerOption
Click to show internal directories.
Click to hide internal directories.