telemetry

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSpanProcessor

func BuildSpanProcessor(ctx context.Context, cfg Config) (trace.SpanProcessor, error)

BuildSpanProcessor builds a span processor based on provided configurations todo - consider fallback mechanism(ex:- to console) if collector is unset

Types

type Config

type Config struct {
	MetricsExporter string
	CollectorTarget string
}

type MetricsRecorder

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

func BuildMetricsRecorder

func BuildMetricsRecorder(svcName string, config Config) (*MetricsRecorder, error)

BuildMetricsRecorder is a helper to build telemetry.MetricsRecorder based on configurations

func NewOTelRecorder

func NewOTelRecorder(exporter metric.Reader, resource *resource.Resource, serviceName string) *MetricsRecorder

NewOTelRecorder creates a MetricsRecorder based on the provided metric.Reader. Note that, metric.NewMeterProvider is created here but not registered globally as this is the only place we derive a metric.Meter. Consider global provider registration if we need more meters

func (MetricsRecorder) HTTPAttributes

func (r MetricsRecorder) HTTPAttributes(svcName, url, method, code string) []attribute.KeyValue

func (MetricsRecorder) HTTPRequestDuration

func (r MetricsRecorder) HTTPRequestDuration(ctx context.Context, duration time.Duration, attrs []attribute.KeyValue)

func (MetricsRecorder) HTTPResponseSize

func (r MetricsRecorder) HTTPResponseSize(ctx context.Context, sizeBytes int64, attrs []attribute.KeyValue)

func (MetricsRecorder) Impressions

func (r MetricsRecorder) Impressions(ctx context.Context, key, variant string)

func (MetricsRecorder) InFlightRequestEnd

func (r MetricsRecorder) InFlightRequestEnd(ctx context.Context, attrs []attribute.KeyValue)

func (MetricsRecorder) InFlightRequestStart

func (r MetricsRecorder) InFlightRequestStart(ctx context.Context, attrs []attribute.KeyValue)

Jump to

Keyboard shortcuts

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