metrics

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailureReason added in v0.7.0

type FailureReason struct {
	GrpcCode    codes.Code
	IsRateLimit bool
}

FailureReason contains extracted information about why a task failed.

type Handler

type Handler interface {
	Int64Counter(name string, description string, unit Unit) Int64Counter
	Int64Gauge(name string, description string, unit Unit) Int64Gauge
	Int64Histogram(name string, description string, unit Unit) Int64Histogram
	WithTags(tags map[string]string) Handler
}

func NewNoOpHandler

func NewNoOpHandler(_ context.Context) Handler

func NewOtelHandler

func NewOtelHandler(_ context.Context, provider otelmetric.MeterProvider, name string) Handler

type Int64Counter

type Int64Counter interface {
	Add(ctx context.Context, value int64, tags map[string]string)
}

type Int64Gauge

type Int64Gauge interface {
	Observe(ctx context.Context, value int64, tags map[string]string)
}

type Int64Histogram

type Int64Histogram interface {
	Record(ctx context.Context, value int64, tags map[string]string)
}

type M

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

func New

func New(handler Handler) *M

func (*M) RecordTaskFailure

func (m *M) RecordTaskFailure(ctx context.Context, task tasks.TaskType, dur time.Duration, err error)

func (*M) RecordTaskSuccess

func (m *M) RecordTaskSuccess(ctx context.Context, task tasks.TaskType, dur time.Duration)

type Unit

type Unit string
const (
	Dimensionless Unit = "1"
	Bytes         Unit = "By"
	Milliseconds  Unit = "ms"
)

Jump to

Keyboard shortcuts

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