Documentation ¶
Overview ¶
Package telemetry provides a way to collect telemetry from function execution - metrics and traces.
Index ¶
- Constants
- func CleanMetricName(metricName string) string
- func Count(ctx context.Context, name string, value int64)
- func InitTelemetry(ctx context.Context, opts *TelemetryOptions) error
- func NewMetricsExporter(ctx context.Context, opts *TelemetryOptions) (metric.Exporter, error)
- func NewTraceExporter(ctx context.Context, opts *TelemetryOptions) (sdktrace.SpanExporter, error)
- func ShutdownTelemetry(ctx context.Context) error
- func Telemetry(ctx context.Context, opts *options.TerragruntOptions, name string, ...) error
- func Time(ctx context.Context, name string, attrs map[string]interface{}, ...) error
- func Trace(ctx context.Context, name string, attrs map[string]interface{}, ...) error
- type ErrorMissingEnvVariable
- type TelemetryOptions
Constants ¶
const (
ErrorsCounter = "errors"
)
Variables ¶
This section is empty.
Functions ¶
func CleanMetricName ¶
CleanMetricName - clean metric name from invalid characters.
func InitTelemetry ¶
func InitTelemetry(ctx context.Context, opts *TelemetryOptions) error
InitTelemetry - initialize the telemetry provider.
func NewMetricsExporter ¶
NewMetricsExporter - create a new exporter based on the telemetry options.
func NewTraceExporter ¶
func NewTraceExporter(ctx context.Context, opts *TelemetryOptions) (sdktrace.SpanExporter, error)
NewTraceExporter - create a new exporter based on the telemetry options.
func ShutdownTelemetry ¶
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.
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 ¶
func (to *TelemetryOptions) GetValue(key, deprecated string) string
GetValue - get variable value, first check for key if not found check for deprecated key.