Version: v1.17.0 Latest Latest

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 29 Imported by: 0




View Source
const (
	// DefaultNumWorkers is the default number of workers consuming from the processor queue
	DefaultNumWorkers = 50
	// DefaultQueueSize is the size of the processor's queue
	DefaultQueueSize = 2000


View Source
var Options options

Options is a factory for all available Option's


func AddFlags

func AddFlags(flags *flag.FlagSet)

AddFlags adds flags for CollectorOptions

func NewSpanProcessor

func NewSpanProcessor(
	spanWriter spanstore.Writer,
	opts ...Option,
) processor.SpanProcessor

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


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) Start

func (c *Collector) Start(builderOpts *CollectorOptions) error

Start the component and underlying dependencies

type CollectorOptions

type CollectorOptions struct {
	// DynQueueSizeMemory determines how much memory to use for the queue
	DynQueueSizeMemory uint
	// QueueSize is the size of collector's queue
	QueueSize int
	// NumWorkers is the number of internal workers in a collector
	NumWorkers int
	// CollectorPort is the port that the collector service listens in on for tchannel requests
	CollectorPort int
	// CollectorHTTPPort is the port that the collector service listens in on for http requests
	CollectorHTTPPort int
	// CollectorGRPCPort is the port that the collector service listens in on for gRPC requests
	CollectorGRPCPort int
	// TLS configures secure transport
	TLS tlscfg.Options
	// CollectorTags is the string representing collector tags to append to each and every span
	CollectorTags map[string]string
	// CollectorZipkinHTTPPort is the port that the Zipkin collector service listens in on for http requests
	CollectorZipkinHTTPPort int
	// CollectorZipkinAllowedOrigins is a list of origins a cross-domain request to the Zipkin collector service can be executed from
	CollectorZipkinAllowedOrigins string
	// CollectorZipkinAllowedHeaders is a list of headers that the Zipkin collector service allowes the client to use with cross-domain requests
	CollectorZipkinAllowedHeaders string

CollectorOptions holds configuration for collector

func (*CollectorOptions) InitFromViper

func (cOpts *CollectorOptions) InitFromViper(v *viper.Viper) *CollectorOptions

InitFromViper initializes CollectorOptions with properties from viper

type CollectorParams

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

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)

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)

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  CollectorOptions
	Logger         *zap.Logger
	MetricsFactory metrics.Factory

SpanHandlerBuilder holds configuration required for handlers

func (*SpanHandlerBuilder) BuildHandlers

BuildHandlers builds span handlers (Zipkin, Jaeger)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto