trace

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTracerName = "cloud-provider-azure"
	DefaultMeterName  = "cloud-provider-azure"
)

Variables

This section is empty.

Functions

func DefaultMeter

func DefaultMeter() apimetric.Meter

func DefaultTracer

func DefaultTracer() apitrace.Tracer

func SetGlobalProvider

func SetGlobalProvider(p *Provider)

Types

type Provider

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

func New

func New() (*Provider, error)

func (*Provider) DefaultMeter

func (p *Provider) DefaultMeter() apimetric.Meter

DefaultMeter returns the default meter.

func (*Provider) MeterProvider

func (p *Provider) MeterProvider() *sdkmetric.MeterProvider

MeterProvider returns the meter provider.

func (*Provider) MetricsHTTPHandler

func (p *Provider) MetricsHTTPHandler() http.Handler

MetricsHTTPHandler returns an HTTP handler for local Prometheus metrics.

func (*Provider) Stop

func (p *Provider) Stop(ctx context.Context) error

Stop stops the provider.

func (*Provider) TracerProvider

func (p *Provider) TracerProvider() *sdktrace.TracerProvider

TracerProvider returns the tracer provider.

type ReconcileSpan

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

ReconcileSpan is a helper for tracing reconcile operations.

func BeginReconcile

func BeginReconcile(ctx context.Context, tracer apitrace.Tracer, name string, attributes ...attribute.KeyValue) (context.Context, *ReconcileSpan)

BeginReconcile starts a new ReconcileSpan and returns the context with the span.

func (*ReconcileSpan) Done

func (c *ReconcileSpan) Done(ctx context.Context)

Done finishes the ReconcileSpan and records the latency.

func (*ReconcileSpan) Errored

func (c *ReconcileSpan) Errored(ctx context.Context, err error)

Errored finishes the ReconcileSpan and records the error.

func (*ReconcileSpan) Inner

func (c *ReconcileSpan) Inner() apitrace.Span

Inner returns the inner span.

func (*ReconcileSpan) Observe

func (c *ReconcileSpan) Observe(ctx context.Context, err error)

Observe observes the result of the reconcile operation. It's a convenience method for calling Done, or Errored. You should not call this method after calling one of the other methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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