app

package
v0.0.0-...-2a2fe1c Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options options

Options is a factory for all available Option's

Functions

func NewSpanProcessor

func NewSpanProcessor(
	spanWriter spanstore.Writer,
	additional []ProcessSpan,
	opts ...Option,
) processor.SpanProcessor

NewSpanProcessor returns a SpanProcessor that preProcesses, filters, queues, sanitizes, and processes spans.

Types

type Collector

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

Collector returns the collector as a manageable unit of work

func New

func New(params *CollectorParams) *Collector

New constructs a new collector component, ready to be started

func (*Collector) Close

func (c *Collector) Close() error

Close the component and all its underlying dependencies

func (*Collector) SpanHandlers

func (c *Collector) SpanHandlers() *SpanHandlers

SpanHandlers returns span handlers used by the Collector.

func (*Collector) Start

func (c *Collector) Start(options *flags.CollectorOptions) error

Start the component and underlying dependencies

type CollectorParams

type CollectorParams struct {
	ServiceName    string
	Logger         *zap.Logger
	MetricsFactory metrics.Factory
	SpanWriter     spanstore.Writer
	StrategyStore  strategystore.StrategyStore
	Aggregator     strategystore.Aggregator
	HealthCheck    *healthcheck.HealthCheck
	TenancyMgr     *tenancy.Manager
}

CollectorParams to construct a new Jaeger Collector.

type FilterSpan

type FilterSpan func(span *model.Span) bool

FilterSpan decides whether to allow or disallow a span

type Option

type Option func(c *options)

Option is a function that sets some option on StorageBuilder.

type ProcessSpan

type ProcessSpan func(span *model.Span, tenant string)

ProcessSpan processes a Domain Model Span

func ChainedProcessSpan

func ChainedProcessSpan(spanProcessors ...ProcessSpan) ProcessSpan

ChainedProcessSpan chains spanProcessors as a single ProcessSpan call

type ProcessSpans

type ProcessSpans func(spans []*model.Span, tenant string)

ProcessSpans processes a batch of Domain Model Spans

type SpanCounts

type SpanCounts struct {
	// ReceivedBySvc maintain by-service metrics.
	ReceivedBySvc metricsBySvc
	// RejectedBySvc is the number of spans we rejected (usually due to blacklisting) by-service.
	RejectedBySvc metricsBySvc
}

SpanCounts contains counts for received and rejected spans.

type SpanCountsByFormat

type SpanCountsByFormat map[processor.SpanFormat]SpanCountsByTransport

SpanCountsByFormat groups metrics by different span formats (thrift, proto, etc.)

type SpanCountsByTransport

type SpanCountsByTransport map[processor.InboundTransport]SpanCounts

SpanCountsByTransport groups metrics by inbound transport (e.g http, grpc, tchannel)

type SpanHandlerBuilder

type SpanHandlerBuilder struct {
	SpanWriter     spanstore.Writer
	CollectorOpts  *flags.CollectorOptions
	Logger         *zap.Logger
	MetricsFactory metrics.Factory
	TenancyMgr     *tenancy.Manager
}

SpanHandlerBuilder holds configuration required for handlers

func (*SpanHandlerBuilder) BuildHandlers

func (b *SpanHandlerBuilder) BuildHandlers(spanProcessor processor.SpanProcessor) *SpanHandlers

BuildHandlers builds span handlers (Zipkin, Jaeger)

func (*SpanHandlerBuilder) BuildSpanProcessor

func (b *SpanHandlerBuilder) BuildSpanProcessor(additional ...ProcessSpan) processor.SpanProcessor

BuildSpanProcessor builds the span processor to be used with the handlers

type SpanHandlers

type SpanHandlers struct {
	ZipkinSpansHandler   handler.ZipkinSpansHandler
	JaegerBatchesHandler handler.JaegerBatchesHandler
	GRPCHandler          *handler.GRPCHandler
}

SpanHandlers holds instances to the span handlers built by the SpanHandlerBuilder

type SpanProcessorMetrics

type SpanProcessorMetrics struct {
	// TODO - initialize metrics in the traditional factory way. Initialize map afterward.
	// SaveLatency measures how long the actual save to storage takes
	SaveLatency metrics.Timer
	// InQueueLatency measures how long the span spends in the queue
	InQueueLatency metrics.Timer
	// SpansDropped measures the number of spans we discarded because the queue was full
	SpansDropped metrics.Counter
	// SpansBytes records how many bytes were processed
	SpansBytes metrics.Gauge
	// BatchSize measures the span batch size
	BatchSize metrics.Gauge // size of span batch
	// QueueCapacity measures the capacity of the internal span queue
	QueueCapacity metrics.Gauge
	// QueueLength measures the current number of elements in the internal span queue
	QueueLength metrics.Gauge
	// SavedOkBySvc contains span and trace counts by service
	SavedOkBySvc  metricsBySvc // spans actually saved
	SavedErrBySvc metricsBySvc // spans failed to save
	// contains filtered or unexported fields
}

SpanProcessorMetrics contains all the necessary metrics for the SpanProcessor

func NewSpanProcessorMetrics

func NewSpanProcessorMetrics(serviceMetrics metrics.Factory, hostMetrics metrics.Factory, otherFormatTypes []processor.SpanFormat) *SpanProcessorMetrics

NewSpanProcessorMetrics returns a SpanProcessorMetrics

func (*SpanProcessorMetrics) GetCountsForFormat

func (m *SpanProcessorMetrics) GetCountsForFormat(spanFormat processor.SpanFormat, transport processor.InboundTransport) SpanCounts

GetCountsForFormat gets the SpanCounts for a given format and transport. If none exists, we use the Unknown format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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