traces

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TracePrefix string = "vs"

Variables

View Source
var (
	BufferedSpansTotal = stats.Float64(
		"traces/stores/buffered_spans/total",
		"Gauge total number of current buffered spans",
		stats.UnitDimensionless,
	)
	BufferedSpansTotalView = &view.View{
		Name:        "traces/stores/buffered_spans/total",
		Description: "Gauge total number of current buffered spans",
		TagKeys:     []tag.Key{bufferName},
		Measure:     BufferedSpansTotal,
		Aggregation: view.LastValue(),
	}
	BufferedSpansPercentage = stats.Float64(
		"traces/stores/buffered_spans/percentage",
		"Gauge percentage full current buffer",
		stats.UnitDimensionless,
	)
	BufferedSpansPercentageView = &view.View{
		Name:        "traces/stores/buffered_spans/percentage",
		Description: "Gauge percentage full current buffer",
		TagKeys:     []tag.Key{bufferName},
		Measure:     BufferedSpansPercentage,
		Aggregation: view.LastValue(),
	}
)

Functions

func Matches added in v0.2.0

func Matches(body string) ([]string, error)

Types

type BufferedSpans

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

BufferedSpans only allows a fixed number of spans at any one time. If the max allowed has been reached it will reject new spans.

func NewBufferedSpanStore added in v0.1.1

func NewBufferedSpanStore(maxAllowedSpans int) (*BufferedSpans, error)

func (*BufferedSpans) Count

func (s *BufferedSpans) Count() (int, error)

func (*BufferedSpans) Delete

func (s *BufferedSpans) Delete(ctx context.Context, id string) error

Delete removes the id, if present, from the buffered spans collection.

func (*BufferedSpans) DeleteAll added in v0.2.0

func (s *BufferedSpans) DeleteAll(ctx context.Context) error

func (*BufferedSpans) Get

func (s *BufferedSpans) Get(ctx context.Context, tracer opentracing.Tracer, id string) (*StoreEntry, error)

func (*BufferedSpans) Monitor

func (s *BufferedSpans) Monitor(ctx context.Context, interval time.Duration, name string)

func (*BufferedSpans) Set

func (s *BufferedSpans) Set(ctx context.Context, id string, entry StoreEntry) error

Set checks to see if there is a free space in the map if there is then it inserts, if there is no free space it returns an error.

type SpanMissingError

type SpanMissingError struct {
	Err error
}

func (SpanMissingError) Error

func (s SpanMissingError) Error() string

type SpanMissingIDError

type SpanMissingIDError struct {
	Err error
}

func (SpanMissingIDError) Error

func (s SpanMissingIDError) Error() string

type SpanStore added in v0.1.1

type SpanStore interface {
	Get(ctx context.Context, tracer opentracing.Tracer, id string) (*StoreEntry, error)
	Set(ctx context.Context, id string, entry StoreEntry) error
	Delete(ctx context.Context, id string) error
	Count() (int, error)
}

type Spans

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

func NewMemoryUnboundedSpanStore added in v0.1.1

func NewMemoryUnboundedSpanStore() *Spans

func (*Spans) Count

func (s *Spans) Count() (int, error)

func (*Spans) Delete

func (s *Spans) Delete(ctx context.Context, id string) error

func (*Spans) Get

func (s *Spans) Get(ctx context.Context, tracer opentracing.Tracer, id string) (*StoreEntry, error)

func (*Spans) Set

func (s *Spans) Set(ctx context.Context, id string, entry StoreEntry) error

type StoreEntry added in v0.2.0

type StoreEntry struct {
	Span      opentracing.Span
	State     *eventsources.EventState
	CreatedAt time.Time
}

func NewStoreEntryFromSpan added in v0.3.0

func NewStoreEntryFromSpan(span opentracing.Span) StoreEntry

func (StoreEntry) Duration added in v0.3.0

func (se StoreEntry) Duration() time.Duration

Jump to

Keyboard shortcuts

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