Documentation ¶
Index ¶
Constants ¶
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 )
const ( // JaegerFormatType is for Jaeger Spans JaegerFormatType = "jaeger" // ZipkinFormatType is for zipkin Spans ZipkinFormatType = "zipkin" // UnknownFormatType is for spans that do not have a widely defined/well-known format type UnknownFormatType = "unknown" )
const (
// UnableToReadBodyErrFormat is an error message for invalid requests
UnableToReadBodyErrFormat = "Unable to process request body: %v"
)
Variables ¶
var Options options
Options is a factory for all available Option's
Functions ¶
func NormalizeServiceName ¶
NormalizeServiceName converts service name to a lowercase string that is safe to use in metrics
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
APIHandler handles all HTTP calls to the collector
func NewAPIHandler ¶
func NewAPIHandler( jaegerBatchesHandler JaegerBatchesHandler, ) *APIHandler
NewAPIHandler returns a new APIHandler
func (*APIHandler) RegisterRoutes ¶
func (aH *APIHandler) RegisterRoutes(router *mux.Router)
RegisterRoutes registers routes for this handler on the given router
type CountsBySpanType ¶
type CountsBySpanType struct { // ReceivedBySvc maintain by-service metrics for a format type ReceivedBySvc metricsBySvc // RejectedBySvc is the number of spans we rejected (usually due to blacklisting) by-service RejectedBySvc metricsBySvc }
CountsBySpanType measures received, rejected, and receivedByService metrics for a format type
type FilterSpan ¶
FilterSpan decides whether to allow or disallow a span
type GRPCHandler ¶ added in v1.9.0
type GRPCHandler struct {
// contains filtered or unexported fields
}
GRPCHandler implements gRPC CollectorService.
func NewGRPCHandler ¶ added in v1.9.0
func NewGRPCHandler(logger *zap.Logger, spanProcessor SpanProcessor) *GRPCHandler
NewGRPCHandler registers routes for this handler on the given router.
func (*GRPCHandler) PostSpans ¶ added in v1.9.0
func (g *GRPCHandler) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) (*api_v2.PostSpansResponse, error)
PostSpans implements gRPC CollectorService.
type JaegerBatchesHandler ¶
type JaegerBatchesHandler interface { // SubmitBatches records a batch of spans in Jaeger Thrift format SubmitBatches(ctx thrift.Context, batches []*jaeger.Batch) ([]*jaeger.BatchSubmitResponse, error) }
JaegerBatchesHandler consumes and handles Jaeger batches
func NewJaegerSpanHandler ¶
func NewJaegerSpanHandler(logger *zap.Logger, modelProcessor SpanProcessor) JaegerBatchesHandler
NewJaegerSpanHandler returns a JaegerBatchesHandler
type Option ¶
type Option func(c *options)
Option is a function that sets some option on StorageBuilder.
type ProcessSpan ¶
ProcessSpan processes a Domain Model Span
func ChainedProcessSpan ¶
func ChainedProcessSpan(spanProcessors ...ProcessSpan) ProcessSpan
ChainedProcessSpan chains spanProcessors as a single ProcessSpan call
type ProcessSpans ¶
ProcessSpans processes a batch of Domain Model Spans
type SpanProcessor ¶
type SpanProcessor interface { // ProcessSpans processes model spans and return with either a list of true/false success or an error ProcessSpans(mSpans []*model.Span, spanFormat string) ([]bool, error) }
SpanProcessor handles model spans
func NewSpanProcessor ¶
func NewSpanProcessor( spanWriter spanstore.Writer, opts ...Option, ) SpanProcessor
NewSpanProcessor returns a SpanProcessor that preProcesses, filters, queues, sanitizes, and processes spans
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 // BatchSize measures the span batch size BatchSize metrics.Gauge // size of span batch // QueueLength measures the size of the internal span queue QueueLength metrics.Gauge // ErrorBusy counts number of return ErrServerBusy ErrorBusy metrics.Counter // 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 []string) *SpanProcessorMetrics
NewSpanProcessorMetrics returns a SpanProcessorMetrics
func (*SpanProcessorMetrics) GetCountsForFormat ¶
func (m *SpanProcessorMetrics) GetCountsForFormat(spanFormat string) CountsBySpanType
GetCountsForFormat gets the countsBySpanType for a given format. If none exists, we use the Unknown format.
type ZipkinSpansHandler ¶
type ZipkinSpansHandler interface { // SubmitZipkinBatch records a batch of spans in Zipkin Thrift format SubmitZipkinBatch(ctx thrift.Context, spans []*zipkincore.Span) ([]*zipkincore.Response, error) }
ZipkinSpansHandler consumes and handles zipkin spans
func NewZipkinSpanHandler ¶
func NewZipkinSpanHandler(logger *zap.Logger, modelHandler SpanProcessor, sanitizer zipkinS.Sanitizer) ZipkinSpansHandler
NewZipkinSpanHandler returns a ZipkinSpansHandler