telemetry

package
v0.0.0-...-6291ac6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SpanContext

func SpanContext(ctx context.Context, methodName string) (context.Context, trace.Span)

func Version

func Version() string

Version is the current release version of goakt in use.

Types

type ActorMetrics

type ActorMetrics struct {
	// captures the number of times a given actor has panic
	PanicCount instrument.Int64ObservableCounter
	// captures the actor mailbox size
	MailboxSize instrument.Int64ObservableGauge
	// captures the number of time the actor has restarted
	RestartedCount instrument.Int64ObservableCounter
	// captures the count of messages received by the actor
	ReceivedCount instrument.Int64ObservableCounter
	// captures the duration of message received and processed
	ReceivedDurationHistogram instrument.Float64Histogram
}

ActorMetrics define the type of metrics we are collecting from an actor

func NewMetrics

func NewMetrics(meter metric.Meter) (*ActorMetrics, error)

NewMetrics creates an instance of ActorMetrics

type Option

type Option interface {
	// Apply sets the Option value of a config.
	Apply(config *Telemetry)
}

Option is the interface that applies a configuration option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

type OptionFunc

type OptionFunc func(*Telemetry)

OptionFunc implements the Option interface.

func (OptionFunc) Apply

func (f OptionFunc) Apply(c *Telemetry)

type SystemMetrics

type SystemMetrics struct {
	// captures the number of actors in the actor system
	ActorSystemActorsCount instrument.Int64ObservableCounter
}

SystemMetrics define the type of metrics we are collecting from the actor system

func NewSystemMetrics

func NewSystemMetrics(meter metric.Meter) (*SystemMetrics, error)

NewSystemMetrics creates an instance of ActorMetrics

type Telemetry

type Telemetry struct {
	TracerProvider trace.TracerProvider
	Tracer         trace.Tracer

	MeterProvider metric.MeterProvider
	Meter         metric.Meter

	Metrics *ActorMetrics
}

Telemetry encapsulates some settings for an actor

func New

func New(options ...Option) *Telemetry

New creates an instance of Telemetry

Jump to

Keyboard shortcuts

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