Documentation
¶
Overview ¶
Package tracing implements the tracing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchLimitsSpec ¶
type BatchLimitsSpec struct {
// MaxQueueSize is the maximum queue size to buffer spans for delayed processing. If the
// queue gets full it drops the spans. Use BlockOnQueueFull to change this behavior.
// The default value of MaxQueueSize is 2048.
MaxQueueSize int `json:"maxQueueSize,omitempty" jsonschema:"default=2048"`
// BatchTimeout is the maximum duration for constructing a batch. Processor
// forcefully sends available spans when timeout is reached.
// The default value of BatchTimeout is 5000 msec.
BatchTimeout int64 `json:"batchTimeout,omitempty" jsonschema:"default=5000"`
// ExportTimeout specifies the maximum duration for exporting spans. If the timeout
// is reached, the export will be cancelled.
// The default value of ExportTimeout is 30000 msec.
ExportTimeout int64 `json:"exportTimeout,omitempty" jsonschema:"default=30000"`
// MaxExportBatchSize is the maximum number of spans to process in a single batch.
// If there are more than one batch worth of spans then it processes multiple batches
// of spans one batch after the other without any delay.
// The default value of MaxExportBatchSize is 512.
MaxExportBatchSize int `json:"maxExportBatchSize,omitempty" jsonschema:"default=512"`
}
BatchLimitsSpec describes BatchSpanProcessorOptions.
type ExporterSpec ¶
type ExporterSpec struct {
Jaeger *JaegerSpec `json:"jaeger,omitempty"`
Zipkin *ZipkinSpec `json:"zipkin,omitempty"`
OTLP *OTLPSpec `json:"otlp,omitempty"`
}
ExporterSpec describes exporter.
type JaegerSpec ¶
type JaegerSpec struct {
Mode jaegerMode `json:"mode" jsonschema:"required,enum=agent,enum=collector"`
Endpoint string `json:"endpoint,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
JaegerSpec describes Jaeger.
type OTLPSpec ¶
type OTLPSpec struct {
Protocol otlpProtocol `json:"protocol" jsonschema:"required,,enum=http,enum=grpc"`
Endpoint string `json:"endpoint" jsonschema:"required"`
Insecure bool `json:"insecure,omitempty"`
Compression string `json:"compression,omitempty" jsonschema:"enum=,enum=gzip"`
}
OTLPSpec describes OpenTelemetry exporter.
type Span ¶
Span is the span of the Tracing.
var NoopSpan *Span
NoopSpan does nothing.
func (*Span) End ¶
func (s *Span) End(options ...trace.SpanEndOption)
End completes the Span. Override trace.Span.End function.
func (*Span) InjectHTTP ¶
InjectHTTP injects span context into an HTTP request.
func (*Span) NewChildWithStart ¶
NewChildWithStart creates a new child span with specified start time.
type SpanLimitsSpec ¶
type SpanLimitsSpec struct {
// AttributeValueLengthLimit is the maximum allowed attribute value length.
//
// This limit only applies to string and string slice attribute values.
// Any string longer than this value will be truncated to this length.
//
// Setting this to a negative value means no limit is applied.
AttributeValueLengthLimit int `json:"attributeValueLengthLimit,omitempty" jsonschema:"default=-1"`
// AttributeCountLimit is the maximum allowed span attribute count. Any
// attribute added to a span once this limit is reached will be dropped.
//
// Setting this to zero means no attributes will be recorded.
//
// Setting this to a negative value means no limit is applied.
AttributeCountLimit int `json:"attributeCountLimit,omitempty" jsonschema:"default=128"`
// EventCountLimit is the maximum allowed span event count. Any event
// added to a span once this limit is reached means it will be added but
// the oldest event will be dropped.
//
// Setting this to zero means no events we be recorded.
//
// Setting this to a negative value means no limit is applied.
EventCountLimit int `json:"eventCountLimit,omitempty" jsonschema:"default=128"`
// LinkCountLimit is the maximum allowed span link count. Any link added
// to a span once this limit is reached means it will be added but the
// oldest link will be dropped.
//
// Setting this to zero means no links we be recorded.
//
// Setting this to a negative value means no limit is applied.
LinkCountLimit int `json:"linkCountLimit,omitempty" jsonschema:"default=128"`
// AttributePerEventCountLimit is the maximum number of attributes allowed
// per span event. Any attribute added after this limit reached will be
// dropped.
//
// Setting this to zero means no attributes will be recorded for events.
//
// Setting this to a negative value means no limit is applied.
AttributePerEventCountLimit int `json:"attributePerEventCountLimit,omitempty" jsonschema:"default=128"`
// AttributePerLinkCountLimit is the maximum number of attributes allowed
// per span link. Any attribute added after this limit reached will be
// dropped.
//
// Setting this to zero means no attributes will be recorded for links.
//
// Setting this to a negative value means no limit is applied.
AttributePerLinkCountLimit int `json:"attributePerLinkCountLimit,omitempty" jsonschema:"default=128"`
}
SpanLimitsSpec represents the limits of a span.
type Spec ¶
type Spec struct {
ServiceName string `json:"serviceName" jsonschema:"required,minLength=1"`
Tags map[string]string `json:"tags,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
SpanLimits *SpanLimitsSpec `json:"spanLimits,omitempty"`
SampleRate float64 `json:"sampleRate,omitempty" jsonschema:"minimum=0,maximum=1,default=1"`
BatchLimits *BatchLimitsSpec `json:"batchLimits,omitempty"`
Exporter *ExporterSpec `json:"exporter,omitempty"`
Zipkin *ZipkinDeprecatedSpec `json:"zipkin,omitempty"`
HeaderFormat headerFormat `json:"headerFormat,omitempty" jsonschema:"default=trace-context,enum=trace-context,enum=b3"`
}
Spec describes Tracer.
func (*Spec) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Tracer ¶
Tracer is the tracer.
var NoopTracer *Tracer
NoopTracer is the tracer doing nothing.
func (*Tracer) IsNoopTracer ¶
IsNoopTracer checks whether tracer is noop tracer.
type ZipkinDeprecatedSpec ¶
type ZipkinDeprecatedSpec struct {
Hostport string `json:"hostport,omitempty"`
ServerURL string `json:"serverURL" jsonschema:"required,format=url"`
DisableReport bool `json:"disableReport,omitempty"`
SampleRate float64 `json:"sampleRate" jsonschema:"required,minimum=0,maximum=1"`
SameSpan bool `json:"sameSpan,omitempty"`
ID128Bit bool `json:"id128Bit,omitempty"`
}
ZipkinDeprecatedSpec describes Zipkin. Deprecated: This option will be kept until the next major version incremented release.
type ZipkinSpec ¶
type ZipkinSpec struct {
Endpoint string `json:"endpoint" jsonschema:"required,format=url"`
}
ZipkinSpec describes Zipkin.