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" jsonschema:"default=2048,omitempty"`
// 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" jsonschema:"default=5000,omitempty"`
// 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" jsonschema:"default=30000,omitempty"`
// 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" jsonschema:"default=512,omitempty"`
}
BatchLimitsSpec describes BatchSpanProcessorOptions.
type ExporterSpec ¶
type ExporterSpec struct {
Jaeger *JaegerSpec `json:"jaeger" jsonschema:"omitempty"`
Zipkin *ZipkinSpec `json:"zipkin" jsonschema:"omitempty"`
OTLP *OTLPSpec `json:"otlp" jsonschema:"omitempty"`
}
ExporterSpec describes exporter.
type JaegerSpec ¶
type JaegerSpec struct {
Mode jaegerMode `json:"mode" jsonschema:"required,enum=agent,enum=collector"`
Endpoint string `json:"endpoint" jsonschema:"omitempty"`
Username string `json:"username" jsonschema:"omitempty"`
Password string `json:"password" jsonschema:"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" jsonschema:"omitempty"`
Compression string `json:"compression" jsonschema:"omitempty,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" jsonschema:"default=-1,omitempty"`
// 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" jsonschema:"default=128,omitempty"`
// 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" jsonschema:"default=128,omitempty"`
// 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" jsonschema:"default=128,omitempty"`
// 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" jsonschema:"default=128,omitempty"`
// 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" jsonschema:"default=128,omitempty"`
}
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" jsonschema:"omitempty"`
Attributes map[string]string `json:"attributes" jsonschema:"omitempty"`
SpanLimits *SpanLimitsSpec `json:"spanLimits" jsonschema:"omitempty"`
SampleRate float64 `json:"sampleRate" jsonschema:"omitempty,minimum=0,maximum=1,default=1"`
BatchLimits *BatchLimitsSpec `json:"batchLimits" jsonschema:"omitempty"`
Exporter *ExporterSpec `json:"exporter" jsonschema:"omitempty"`
Zipkin *ZipkinDeprecatedSpec `json:"zipkin" jsonschema:"omitempty"`
HeaderFormat headerFormat `json:"headerFormat" jsonschema:"omitempty,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" jsonschema:"omitempty"`
ServerURL string `json:"serverURL" jsonschema:"required,format=url"`
DisableReport bool `json:"disableReport" jsonschema:"omitempty"`
SampleRate float64 `json:"sampleRate" jsonschema:"required,minimum=0,maximum=1"`
SameSpan bool `json:"sameSpan" jsonschema:"omitempty"`
ID128Bit bool `json:"id128Bit" jsonschema:"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.