instrumentation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithTransaction

func ContextWithTransaction(ctx context.Context, txn Transaction) context.Context

func InitSelfInstrumentation

func InitSelfInstrumentation(c *config.Config, resolver hostname.Resolver)

func NewGauge

func NewGauge(name string, val float64) metric

func NewGaugeWithAttributes

func NewGaugeWithAttributes(name string, val float64, attrs map[string]interface{}) metric

Types

type AgentInstrumentation

type AgentInstrumentation interface {
	StartTransaction(ctx context.Context, name string) (context.Context, Transaction)
	RecordMetric(ctx context.Context, metric metric)
}

AgentInstrumentation does it make sense to abstract it?

var SelfInstrumentation AgentInstrumentation = noopInstrumentation{}

func NewAgentInstrumentationApm

func NewAgentInstrumentationApm(license string, apmEndpoint string, telemetryEndpoint string, resolver hostname.Resolver) (AgentInstrumentation, error)

type MetricType

type MetricType int64
const (
	Gauge MetricType = iota
	Sum
	Histrogram
)

type NoopSegment

type NoopSegment struct {
}

func (NoopSegment) AddAttribute

func (n NoopSegment) AddAttribute(key string, value interface{})

func (NoopSegment) End

func (n NoopSegment) End()

type NoopTransaction

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

func (NoopTransaction) AddAttribute

func (n NoopTransaction) AddAttribute(key string, value interface{})

func (NoopTransaction) End

func (n NoopTransaction) End()

func (NoopTransaction) NoticeError

func (n NoopTransaction) NoticeError(_ error)

func (NoopTransaction) StartExternalSegment

func (n NoopTransaction) StartExternalSegment(ctx context.Context, name string, req *http.Request) (context.Context, Segment)

func (NoopTransaction) StartSegment

func (n NoopTransaction) StartSegment(ctx context.Context, _ string) (context.Context, Segment)

type Segment

type Segment interface {
	AddAttribute(key string, value interface{})
	End()
}

type SegmentApm

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

func (*SegmentApm) AddAttribute

func (t *SegmentApm) AddAttribute(key string, value interface{})

func (*SegmentApm) End

func (t *SegmentApm) End()

type Transaction

type Transaction interface {
	StartSegment(ctx context.Context, name string) (context.Context, Segment)
	StartExternalSegment(ctx context.Context, name string, req *http.Request) (context.Context, Segment)
	AddAttribute(key string, value interface{})
	End()
	NoticeError(err error)
}

func TransactionFromContext

func TransactionFromContext(ctx context.Context) Transaction

type TransactionApm

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

func (*TransactionApm) AddAttribute

func (t *TransactionApm) AddAttribute(key string, value interface{})

func (*TransactionApm) End

func (t *TransactionApm) End()

func (*TransactionApm) NoticeError

func (t *TransactionApm) NoticeError(err error)

func (*TransactionApm) StartExternalSegment

func (t *TransactionApm) StartExternalSegment(ctx context.Context, name string, req *http.Request) (context.Context, Segment)

func (*TransactionApm) StartSegment

func (t *TransactionApm) StartSegment(ctx context.Context, name string) (context.Context, Segment)

Jump to

Keyboard shortcuts

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