metrics

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MaxTagsCount is the maximum number of tags allowed
	MaxTagsCount = 50

	ReportingIntervalDefault = 60 // default metrics flush interval in seconds
)
View Source
const (
	OtherTransactionName = "other"
	MetricIDSeparator    = "&"
	TagsKVSeparator      = ":"
)

Special transaction names

View Source
const (
	RequestCount               = "RequestCount"
	TraceCount                 = "TraceCount"
	TokenBucketExhaustionCount = "TokenBucketExhaustionCount"
	SampleCount                = "SampleCount"
	ThroughTraceCount          = "ThroughTraceCount"
	TriggeredTraceCount        = "TriggeredTraceCount"
)

Request counters definition

Variables

View Source
var (
	// ErrExceedsMetricsCountLimit indicates there are too many distinct metrics.
	ErrExceedsMetricsCountLimit = errors.New("exceeds metrics count limit per flush interval")
	// ErrExceedsTagsCountLimit indicates there are too many tags
	ErrExceedsTagsCountLimit = errors.New("exceeds tags count limit")
	// ErrMetricsWithNonPositiveCount indicates the count is negative or zero
	ErrMetricsWithNonPositiveCount = errors.New("metrics with non-positive count")
)

Functions

func GetTransactionFromPath

func GetTransactionFromPath(path string) string

GetTransactionFromPath performs fingerprinting on a given escaped path to extract the transaction name We can get the path so there is no need to parse the full URL. e.g. Escaped Path path: /solarwinds/apm-go/blob/metrics becomes /solarwinds/apm-go

func TemporalitySelector added in v1.1.0

func TemporalitySelector(sdkmetric.InstrumentKind) metricdata.Temporality

Types

type BaseSpanMessage

type BaseSpanMessage struct {
	Duration time.Duration // duration of the span (nanoseconds)
	HasError bool          // boolean flag whether this transaction contains an error or not
}

BaseSpanMessage is the base span message with properties found in all types of span messages

type EventQueueStats

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

EventQueueStats is the counters of the event queue stats All the fields are supposed to be accessed through atomic operations

func (*EventQueueStats) CopyAndReset

func (s *EventQueueStats) CopyAndReset() *EventQueueStats

CopyAndReset returns a copy of its current values and reset itself.

func (*EventQueueStats) NumFailedAdd

func (s *EventQueueStats) NumFailedAdd(n int64)

func (*EventQueueStats) NumOverflowedAdd

func (s *EventQueueStats) NumOverflowedAdd(n int64)

func (*EventQueueStats) NumSentAdd

func (s *EventQueueStats) NumSentAdd(n int64)

func (*EventQueueStats) SetQueueLargest

func (s *EventQueueStats) SetQueueLargest(count int64)

func (*EventQueueStats) TotalEventsAdd

func (s *EventQueueStats) TotalEventsAdd(n int64)

type HTTPSpanMessage

type HTTPSpanMessage struct {
	BaseSpanMessage
	Transaction string // transaction name (e.g. controller.action)
	Path        string // the url path which will be processed and used as transaction (if Transaction is empty)
	Status      int    // HTTP status code (e.g. 200, 500, ...)
	Host        string // HTTP-Host // This could be removed (-jared)
	Method      string // HTTP method (e.g. GET, POST, ...)
}

HTTPSpanMessage is used for inbound metrics

type LegacyRegistry added in v1.1.0

type LegacyRegistry interface {
	MetricRegistry
	BuildBuiltinMetricsMessage(flushInterval int32, qs *EventQueueStats,
		rcs *RateCountSummary, runtimeMetrics bool) []byte
	BuildCustomMetricsMessage(flushInterval int32) []byte
	ApmMetricsCap() int32
	SetApmMetricsCap(int32)
	CustomMetricsCap() int32
	SetCustomMetricsCap(int32)
}

func NewLegacyRegistry added in v1.1.0

func NewLegacyRegistry(isAppoptics bool) LegacyRegistry

type MetricOptions

type MetricOptions struct {
	Count   int
	HostTag bool
	Tags    map[string]string
}

MetricOptions is a struct for the optional parameters of a measurement.

type MetricRegistry added in v1.1.0

type MetricRegistry interface {
	RecordSpan(span trace.ReadOnlySpan)
}

func NewOtelRegistry added in v1.1.0

func NewOtelRegistry(p metric.MeterProvider) (MetricRegistry, error)

type RateCountSummary added in v1.1.0

type RateCountSummary struct {
	Requested, Traced, Limited, TtTraced, Sampled, Through int64
}

RateCountSummary is used to merge RateCounts from multiple token buckets

type RateCounts

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

RateCounts is the rate counts reported by trace sampler

func (*RateCounts) FlushRateCounts

func (c *RateCounts) FlushRateCounts() *RateCounts

FlushRateCounts reset the counters and returns the current value

func (*RateCounts) Limited

func (c *RateCounts) Limited() int64

func (*RateCounts) LimitedInc

func (c *RateCounts) LimitedInc()

func (*RateCounts) Requested

func (c *RateCounts) Requested() int64

func (*RateCounts) RequestedInc

func (c *RateCounts) RequestedInc()

func (*RateCounts) Sampled

func (c *RateCounts) Sampled() int64

func (*RateCounts) SampledInc

func (c *RateCounts) SampledInc()

func (*RateCounts) Through

func (c *RateCounts) Through() int64

func (*RateCounts) ThroughInc

func (c *RateCounts) ThroughInc()

func (*RateCounts) Traced

func (c *RateCounts) Traced() int64

func (*RateCounts) TracedInc

func (c *RateCounts) TracedInc()

type SpanMessage

type SpanMessage interface {
	Process(m *measurements)
}

SpanMessage defines a span message

Jump to

Keyboard shortcuts

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