telemetry

package
v0.70.0-beta2024120501 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package telemetry provides a way to collect telemetry from function execution - metrics and traces.

Index

Constants

View Source
const (
	ErrorsCounter = "errors"
)

Variables

This section is empty.

Functions

func CleanMetricName added in v0.66.7

func CleanMetricName(metricName string) string

CleanMetricName - clean metric name from invalid characters.

func Count

func Count(ctx context.Context, name string, value int64)

Count - add to counter provided value

func InitTelemetry

func InitTelemetry(ctx context.Context, opts *TelemetryOptions) error

InitTelemetry - initialize the telemetry provider.

func NewMetricsExporter added in v0.66.7

func NewMetricsExporter(ctx context.Context, opts *TelemetryOptions) (metric.Exporter, error)

NewMetricsExporter - create a new exporter based on the telemetry options.

func NewTraceExporter added in v0.66.7

func NewTraceExporter(ctx context.Context, opts *TelemetryOptions) (sdktrace.SpanExporter, error)

NewTraceExporter - create a new exporter based on the telemetry options.

func ShutdownTelemetry

func ShutdownTelemetry(ctx context.Context) error

ShutdownTelemetry - shutdown the telemetry provider.

func Telemetry

func Telemetry(ctx context.Context, opts *options.TerragruntOptions, name string, attrs map[string]interface{}, fn func(childCtx context.Context) error) error

Telemetry - collect telemetry from function execution - metrics and traces.

func Time

func Time(ctx context.Context, name string, attrs map[string]interface{}, fn func(childCtx context.Context) error) error

Time - collect time for function execution

func Trace

func Trace(ctx context.Context, name string, attrs map[string]interface{}, fn func(childCtx context.Context) error) error

Trace - collect traces for method execution

Types

type ErrorMissingEnvVariable

type ErrorMissingEnvVariable struct {
	Vars []string
}

ErrorMissingEnvVariable error for missing environment variable.

func (*ErrorMissingEnvVariable) Error

func (e *ErrorMissingEnvVariable) Error() string

type TelemetryOptions

type TelemetryOptions struct {
	Vars       map[string]string
	AppName    string
	AppVersion string
	Writer     io.Writer
	ErrWriter  io.Writer
}

TelemetryOptions - options for telemetry provider.

func (*TelemetryOptions) GetValue added in v0.63.7

func (to *TelemetryOptions) GetValue(key, deprecated string) string

GetValue - get variable value, first check for key if not found check for deprecated key.

Jump to

Keyboard shortcuts

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