observability

package
v0.0.0-...-5785f03 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 24 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndSpan

func EndSpan(ctx context.Context)

func StartSpan

func StartSpan(name string, ctx context.Context, attributes *map[string]string) (context.Context, trace.Span)

Types

type Counter

type Counter interface {
	// Add adds the current value of the counter.
	Add(incr float64, attrs ...map[string]any)

	// Close stops the counter from emitting values after the next
	// measurement cycle.
	Close()
}

Counter is an instrument to be used to record the sum of float64 values once per measurement cycle and then resetting. No trace context.

type ExporterConfig

type ExporterConfig struct {
	Type         string        `json:"type"`
	BackendUrl   string        `json:"backendUrl"`
	Sampler      SamplerConfig `json:"sampler"`
	CollectorUrl string        `json:"collectorUrl"`
	Temporality  bool          `json:"temporality"`
}

type Gauge

type Gauge interface {
	// Set sets the current value of the gauge.
	Set(value float64, attrs ...map[string]any)

	// Close stops the gauge from emitting values after the next measurement
	// cycle.
	Close()
}

Gauge is a instrument to be used to emit values once per measurement cycle and then resetting.

type Histogram

type Histogram interface {
	// Add records a change to the instrument.
	Add(incr float64, attrs ...map[string]any)
}

Histogram is a instrument to be used to record the distribution of float64 measurements.

type Metrics

type Metrics interface {
	// Counter returns a new Counter.
	Counter(
		name, description string,
		attrs ...map[string]any,
	) (Counter, error)

	// Gauge returns a new Gauge. Attributes applied at the gauge level will
	// be applied to every value emitted; attributes applied at the value
	// level will take precedence. Each unique value combination of
	// attributes will be emitted as separate values so if you want values
	// to be grouped together, they must have the same attribute set.
	Gauge(
		name, description string,
		attrs ...map[string]any,
	) (Gauge, error)

	// Histogram returns a new Histogram.
	Histogram(
		name, description string,
		attrs ...map[string]any,
	) (Histogram, error)
}

Metrics provides the implementation for dealing with metrics. Metrics are used to measure quantitative data over time, such as the rate of requests or the memory usage of a system.

type Observability

type Observability struct {
	Tracer         trace.Tracer
	TracerProvider trace.TracerProvider
	Buffer         *v1alpha2.SafeBuffer // should be a thread safe buffer
	Metrics        *metrics
}

func New

func New(symphonyProject string) Observability

New returns a new instance of the observability.

func (*Observability) Init

func (o *Observability) Init(config ObservabilityConfig) error

func (*Observability) InitMetric

func (o *Observability) InitMetric(config ObservabilityConfig) error

func (*Observability) InitTrace

func (o *Observability) InitTrace(config ObservabilityConfig) error

func (*Observability) Shutdown

func (o *Observability) Shutdown(ctx context.Context) error

type ObservabilityConfig

type ObservabilityConfig struct {
	Pipelines   []PipelineConfig `json:"pipelines"`
	ServiceName string           `json:"serviceName"`
}

type PipelineConfig

type PipelineConfig struct {
	Exporter ExporterConfig `json:"exporter"`
}

type ProcessorConfig

type ProcessorConfig struct {
}

type ProviderConfig

type ProviderConfig struct {
}

type SamplerConfig

type SamplerConfig struct {
	SampleRate string `json:"sampleRate"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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