Documentation ¶
Index ¶
- Constants
- Variables
- type Annotation
- func (p *Annotation) Equals(other *Annotation) bool
- func (p *Annotation) GetHost() *Endpoint
- func (p *Annotation) GetTimestamp() int64
- func (p *Annotation) GetValue() string
- func (p *Annotation) IsSetHost() bool
- func (p *Annotation) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Annotation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Annotation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Annotation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Annotation) String() string
- func (p *Annotation) Validate() error
- func (p *Annotation) Write(ctx context.Context, oprot thrift.TProtocol) error
- type AnnotationType
- type BinaryAnnotation
- func (p *BinaryAnnotation) Equals(other *BinaryAnnotation) bool
- func (p *BinaryAnnotation) GetAnnotationType() AnnotationType
- func (p *BinaryAnnotation) GetHost() *Endpoint
- func (p *BinaryAnnotation) GetKey() string
- func (p *BinaryAnnotation) GetValue() []byte
- func (p *BinaryAnnotation) IsSetHost() bool
- func (p *BinaryAnnotation) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *BinaryAnnotation) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *BinaryAnnotation) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *BinaryAnnotation) ReadField3(ctx context.Context, iprot thrift.TProtocol) error
- func (p *BinaryAnnotation) ReadField4(ctx context.Context, iprot thrift.TProtocol) error
- func (p *BinaryAnnotation) String() string
- func (p *BinaryAnnotation) Validate() error
- func (p *BinaryAnnotation) Write(ctx context.Context, oprot thrift.TProtocol) error
- type Endpoint
- func (p *Endpoint) Equals(other *Endpoint) bool
- func (p *Endpoint) GetIpv4() int32
- func (p *Endpoint) GetIpv6() []byte
- func (p *Endpoint) GetPort() int16
- func (p *Endpoint) GetServiceName() string
- func (p *Endpoint) IsSetIpv6() bool
- func (p *Endpoint) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Endpoint) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Endpoint) ReadField2(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Endpoint) ReadField3(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Endpoint) ReadField4(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Endpoint) String() string
- func (p *Endpoint) Validate() error
- func (p *Endpoint) Write(ctx context.Context, oprot thrift.TProtocol) error
- type Response
- func (p *Response) Equals(other *Response) bool
- func (p *Response) GetOk() bool
- func (p *Response) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Response) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Response) String() string
- func (p *Response) Validate() error
- func (p *Response) Write(ctx context.Context, oprot thrift.TProtocol) error
- type Span
- func (p *Span) Equals(other *Span) bool
- func (p *Span) GetAnnotations() []*Annotation
- func (p *Span) GetBinaryAnnotations() []*BinaryAnnotation
- func (p *Span) GetDebug() bool
- func (p *Span) GetDuration() int64
- func (p *Span) GetID() int64
- func (p *Span) GetName() string
- func (p *Span) GetParentID() int64
- func (p *Span) GetTimestamp() int64
- func (p *Span) GetTraceID() int64
- func (p *Span) GetTraceIDHigh() int64
- func (p *Span) IsSetDebug() bool
- func (p *Span) IsSetDuration() bool
- func (p *Span) IsSetParentID() bool
- func (p *Span) IsSetTimestamp() bool
- func (p *Span) IsSetTraceIDHigh() bool
- func (p *Span) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField10(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField11(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField12(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField3(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField4(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField5(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField6(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField8(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) ReadField9(ctx context.Context, iprot thrift.TProtocol) error
- func (p *Span) String() string
- func (p *Span) Validate() error
- func (p *Span) Write(ctx context.Context, oprot thrift.TProtocol) error
- type ZipkinCollector
- type ZipkinCollectorClient
- func NewZipkinCollectorClient(c thrift.TClient) *ZipkinCollectorClient
- func NewZipkinCollectorClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ZipkinCollectorClient
- func NewZipkinCollectorClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ZipkinCollectorClient
- func (p *ZipkinCollectorClient) Client_() thrift.TClient
- func (p *ZipkinCollectorClient) LastResponseMeta_() thrift.ResponseMeta
- func (p *ZipkinCollectorClient) SetLastResponseMeta_(meta thrift.ResponseMeta)
- func (p *ZipkinCollectorClient) SubmitZipkinBatch(ctx context.Context, spans []*Span) (_r []*Response, _err error)
- type ZipkinCollectorProcessor
- func (p *ZipkinCollectorProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
- func (p *ZipkinCollectorProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
- func (p *ZipkinCollectorProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
- func (p *ZipkinCollectorProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
- type ZipkinCollectorSubmitZipkinBatchArgs
- func (p *ZipkinCollectorSubmitZipkinBatchArgs) GetSpans() []*Span
- func (p *ZipkinCollectorSubmitZipkinBatchArgs) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *ZipkinCollectorSubmitZipkinBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error
- func (p *ZipkinCollectorSubmitZipkinBatchArgs) String() string
- func (p *ZipkinCollectorSubmitZipkinBatchArgs) Write(ctx context.Context, oprot thrift.TProtocol) error
- type ZipkinCollectorSubmitZipkinBatchResult
- func (p *ZipkinCollectorSubmitZipkinBatchResult) GetSuccess() []*Response
- func (p *ZipkinCollectorSubmitZipkinBatchResult) IsSetSuccess() bool
- func (p *ZipkinCollectorSubmitZipkinBatchResult) Read(ctx context.Context, iprot thrift.TProtocol) error
- func (p *ZipkinCollectorSubmitZipkinBatchResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error
- func (p *ZipkinCollectorSubmitZipkinBatchResult) String() string
- func (p *ZipkinCollectorSubmitZipkinBatchResult) Write(ctx context.Context, oprot thrift.TProtocol) error
Constants ¶
const CLIENT_ADDR = "ca"
const CLIENT_RECV = "cr"
const CLIENT_RECV_FRAGMENT = "crf"
const CLIENT_SEND = "cs"
const CLIENT_SEND_FRAGMENT = "csf"
const LOCAL_COMPONENT = "lc"
const MESSAGE_ADDR = "ma"
const MESSAGE_RECV = "mr"
const MESSAGE_SEND = "ms"
const SERVER_ADDR = "sa"
const SERVER_RECV = "sr"
const SERVER_RECV_FRAGMENT = "srf"
const SERVER_SEND = "ss"
const SERVER_SEND_FRAGMENT = "ssf"
const WIRE_RECV = "wr"
const WIRE_SEND = "ws"
Variables ¶
var Endpoint_Ipv6_DEFAULT []byte
var GoUnusedProtection__ int
var Span_Debug_DEFAULT bool = false
var Span_Duration_DEFAULT int64
var Span_ParentID_DEFAULT int64
var Span_Timestamp_DEFAULT int64
var Span_TraceIDHigh_DEFAULT int64
var ZipkinCollectorSubmitZipkinBatchResult_Success_DEFAULT []*Response
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct { Timestamp int64 `thrift:"timestamp,1" db:"timestamp" json:"timestamp"` Value string `thrift:"value,2" db:"value" json:"value"` Host *Endpoint `thrift:"host,3" db:"host" json:"host,omitempty"` }
An annotation is similar to a log statement. It includes a host field which allows these events to be attributed properly, and also aggregatable.
Attributes:
- Timestamp: Microseconds from epoch.
This value should use the most precise value possible. For example, gettimeofday or syncing nanoTime against a tick of currentTimeMillis.
- Value
- Host: Always the host that recorded the event. By specifying the host you allow
rollup of all events (such as client requests to a service) by IP address.
func NewAnnotation ¶
func NewAnnotation() *Annotation
func (*Annotation) Equals ¶ added in v1.23.0
func (p *Annotation) Equals(other *Annotation) bool
func (*Annotation) GetHost ¶
func (p *Annotation) GetHost() *Endpoint
func (*Annotation) GetTimestamp ¶
func (p *Annotation) GetTimestamp() int64
func (*Annotation) GetValue ¶
func (p *Annotation) GetValue() string
func (*Annotation) IsSetHost ¶
func (p *Annotation) IsSetHost() bool
func (*Annotation) ReadField1 ¶ added in v1.19.0
func (*Annotation) ReadField2 ¶ added in v1.19.0
func (*Annotation) ReadField3 ¶ added in v1.19.0
func (*Annotation) String ¶
func (p *Annotation) String() string
func (*Annotation) Validate ¶ added in v1.53.0
func (p *Annotation) Validate() error
type AnnotationType ¶
type AnnotationType int64
const ( AnnotationType_BOOL AnnotationType = 0 AnnotationType_BYTES AnnotationType = 1 AnnotationType_I16 AnnotationType = 2 AnnotationType_I32 AnnotationType = 3 AnnotationType_I64 AnnotationType = 4 AnnotationType_DOUBLE AnnotationType = 5 AnnotationType_STRING AnnotationType = 6 )
func AnnotationTypeFromString ¶
func AnnotationTypeFromString(s string) (AnnotationType, error)
func AnnotationTypePtr ¶
func AnnotationTypePtr(v AnnotationType) *AnnotationType
func (AnnotationType) MarshalText ¶
func (p AnnotationType) MarshalText() ([]byte, error)
func (*AnnotationType) Scan ¶ added in v1.19.0
func (p *AnnotationType) Scan(value interface{}) error
func (AnnotationType) String ¶
func (p AnnotationType) String() string
func (*AnnotationType) UnmarshalText ¶
func (p *AnnotationType) UnmarshalText(text []byte) error
type BinaryAnnotation ¶
type BinaryAnnotation struct { Key string `thrift:"key,1" db:"key" json:"key"` Value []byte `thrift:"value,2" db:"value" json:"value"` AnnotationType AnnotationType `thrift:"annotation_type,3" db:"annotation_type" json:"annotation_type"` Host *Endpoint `thrift:"host,4" db:"host" json:"host,omitempty"` }
Binary annotations are tags applied to a Span to give it context. For example, a binary annotation of "http.uri" could the path to a resource in a RPC call.
Binary annotations of type STRING are always queryable, though more a historical implementation detail than a structural concern.
Binary annotations can repeat, and vary on the host. Similar to Annotation, the host indicates who logged the event. This allows you to tell the difference between the client and server side of the same key. For example, the key "http.uri" might be different on the client and server side due to rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field, you can see the different points of view, which often help in debugging.
Attributes:
- Key
- Value
- AnnotationType
- Host: The host that recorded tag, which allows you to differentiate between
multiple tags with the same key. There are two exceptions to this.
When the key is CLIENT_ADDR or SERVER_ADDR, host indicates the source or destination of an RPC. This exception allows zipkin to display network context of uninstrumented services, or clients such as web browsers.
func NewBinaryAnnotation ¶
func NewBinaryAnnotation() *BinaryAnnotation
func (*BinaryAnnotation) Equals ¶ added in v1.23.0
func (p *BinaryAnnotation) Equals(other *BinaryAnnotation) bool
func (*BinaryAnnotation) GetAnnotationType ¶
func (p *BinaryAnnotation) GetAnnotationType() AnnotationType
func (*BinaryAnnotation) GetHost ¶
func (p *BinaryAnnotation) GetHost() *Endpoint
func (*BinaryAnnotation) GetKey ¶
func (p *BinaryAnnotation) GetKey() string
func (*BinaryAnnotation) GetValue ¶
func (p *BinaryAnnotation) GetValue() []byte
func (*BinaryAnnotation) IsSetHost ¶
func (p *BinaryAnnotation) IsSetHost() bool
func (*BinaryAnnotation) ReadField1 ¶ added in v1.19.0
func (*BinaryAnnotation) ReadField2 ¶ added in v1.19.0
func (*BinaryAnnotation) ReadField3 ¶ added in v1.19.0
func (*BinaryAnnotation) ReadField4 ¶ added in v1.19.0
func (*BinaryAnnotation) String ¶
func (p *BinaryAnnotation) String() string
func (*BinaryAnnotation) Validate ¶ added in v1.53.0
func (p *BinaryAnnotation) Validate() error
type Endpoint ¶
type Endpoint struct { Ipv4 int32 `thrift:"ipv4,1" db:"ipv4" json:"ipv4"` Port int16 `thrift:"port,2" db:"port" json:"port"` ServiceName string `thrift:"service_name,3" db:"service_name" json:"service_name"` Ipv6 []byte `thrift:"ipv6,4" db:"ipv6" json:"ipv6,omitempty"` }
Indicates the network context of a service recording an annotation with two exceptions.
When a BinaryAnnotation, and key is CLIENT_ADDR or SERVER_ADDR, the endpoint indicates the source or destination of an RPC. This exception allows zipkin to display network context of uninstrumented services, or clients such as web browsers.
Attributes:
- Ipv4: IPv4 host address packed into 4 bytes.
Ex for the ip 1.2.3.4, it would be (1 << 24) | (2 << 16) | (3 << 8) | 4
- Port: IPv4 port
Note: this is to be treated as an unsigned integer, so watch for negatives.
Conventionally, when the port isn't known, port = 0.
- ServiceName: Service name in lowercase, such as "memcache" or "zipkin-web"
Conventionally, when the service name isn't known, service_name = "unknown".
- Ipv6: IPv6 host address packed into 16 bytes. Ex Inet6Address.getBytes()
var Annotation_Host_DEFAULT *Endpoint
var BinaryAnnotation_Host_DEFAULT *Endpoint
func NewEndpoint ¶
func NewEndpoint() *Endpoint
func (*Endpoint) GetServiceName ¶
func (*Endpoint) ReadField1 ¶ added in v1.19.0
func (*Endpoint) ReadField2 ¶ added in v1.19.0
func (*Endpoint) ReadField3 ¶ added in v1.19.0
func (*Endpoint) ReadField4 ¶ added in v1.19.0
type Response ¶
type Response struct {
Ok bool `thrift:"ok,1,required" db:"ok" json:"ok"`
}
Attributes:
- Ok
func NewResponse ¶
func NewResponse() *Response
func (*Response) ReadField1 ¶ added in v1.19.0
type Span ¶
type Span struct { TraceID int64 `thrift:"trace_id,1" db:"trace_id" json:"trace_id"` // unused field # 2 Name string `thrift:"name,3" db:"name" json:"name"` ID int64 `thrift:"id,4" db:"id" json:"id"` ParentID *int64 `thrift:"parent_id,5" db:"parent_id" json:"parent_id,omitempty"` Annotations []*Annotation `thrift:"annotations,6" db:"annotations" json:"annotations"` // unused field # 7 BinaryAnnotations []*BinaryAnnotation `thrift:"binary_annotations,8" db:"binary_annotations" json:"binary_annotations"` Debug bool `thrift:"debug,9" db:"debug" json:"debug"` Timestamp *int64 `thrift:"timestamp,10" db:"timestamp" json:"timestamp,omitempty"` Duration *int64 `thrift:"duration,11" db:"duration" json:"duration,omitempty"` TraceIDHigh *int64 `thrift:"trace_id_high,12" db:"trace_id_high" json:"trace_id_high,omitempty"` }
A trace is a series of spans (often RPC calls) which form a latency tree.
The root span is where trace_id = id and parent_id = Nil. The root span is usually the longest interval in the trace, starting with a SERVER_RECV annotation and ending with a SERVER_SEND.
Attributes:
- TraceID
- Name: Span name in lowercase, rpc method for example
Conventionally, when the span name isn't known, name = "unknown".
- ID
- ParentID
- Annotations
- BinaryAnnotations
- Debug
- Timestamp: Microseconds from epoch of the creation of this span.
This value should be set directly by instrumentation, using the most precise value possible. For example, gettimeofday or syncing nanoTime against a tick of currentTimeMillis.
For compatibility with instrumentation that precede this field, collectors or span stores can derive this via Annotation.timestamp. For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp.
This field is optional for compatibility with old data: first-party span stores are expected to support this at time of introduction.
- Duration: Measurement of duration in microseconds, used to support queries.
This value should be set directly, where possible. Doing so encourages precise measurement decoupled from problems of clocks, such as skew or NTP updates causing time to move backwards.
For compatibility with instrumentation that precede this field, collectors or span stores can derive this by subtracting Annotation.timestamp. For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp.
If this field is persisted as unset, zipkin will continue to work, except duration query support will be implementation-specific. Similarly, setting this field non-atomically is implementation-specific.
This field is i64 vs i32 to support spans longer than 35 minutes.
- TraceIDHigh: Optional unique 8-byte additional identifier for a trace. If non zero, this
means the trace uses 128 bit traceIds instead of 64 bit.
func (*Span) GetAnnotations ¶
func (p *Span) GetAnnotations() []*Annotation
func (*Span) GetBinaryAnnotations ¶
func (p *Span) GetBinaryAnnotations() []*BinaryAnnotation
func (*Span) GetDuration ¶
func (*Span) GetParentID ¶
func (*Span) GetTimestamp ¶
func (*Span) GetTraceID ¶
func (*Span) GetTraceIDHigh ¶ added in v0.7.0
func (*Span) IsSetDebug ¶
func (*Span) IsSetDuration ¶
func (*Span) IsSetParentID ¶
func (*Span) IsSetTimestamp ¶
func (*Span) IsSetTraceIDHigh ¶ added in v0.7.0
func (*Span) ReadField1 ¶ added in v1.19.0
func (*Span) ReadField10 ¶ added in v1.19.0
func (*Span) ReadField11 ¶ added in v1.19.0
func (*Span) ReadField12 ¶ added in v1.19.0
func (*Span) ReadField3 ¶ added in v1.19.0
func (*Span) ReadField4 ¶ added in v1.19.0
func (*Span) ReadField5 ¶ added in v1.19.0
func (*Span) ReadField6 ¶ added in v1.19.0
func (*Span) ReadField8 ¶ added in v1.19.0
func (*Span) ReadField9 ¶ added in v1.19.0
type ZipkinCollector ¶
type ZipkinCollectorClient ¶
type ZipkinCollectorClient struct {
// contains filtered or unexported fields
}
func NewZipkinCollectorClient ¶ added in v1.19.0
func NewZipkinCollectorClient(c thrift.TClient) *ZipkinCollectorClient
func NewZipkinCollectorClientFactory ¶
func NewZipkinCollectorClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ZipkinCollectorClient
func NewZipkinCollectorClientProtocol ¶
func NewZipkinCollectorClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ZipkinCollectorClient
func (*ZipkinCollectorClient) Client_ ¶ added in v1.19.0
func (p *ZipkinCollectorClient) Client_() thrift.TClient
func (*ZipkinCollectorClient) LastResponseMeta_ ¶ added in v1.23.0
func (p *ZipkinCollectorClient) LastResponseMeta_() thrift.ResponseMeta
func (*ZipkinCollectorClient) SetLastResponseMeta_ ¶ added in v1.23.0
func (p *ZipkinCollectorClient) SetLastResponseMeta_(meta thrift.ResponseMeta)
func (*ZipkinCollectorClient) SubmitZipkinBatch ¶
func (p *ZipkinCollectorClient) SubmitZipkinBatch(ctx context.Context, spans []*Span) (_r []*Response, _err error)
Parameters:
- Spans
type ZipkinCollectorProcessor ¶
type ZipkinCollectorProcessor struct {
// contains filtered or unexported fields
}
func NewZipkinCollectorProcessor ¶
func NewZipkinCollectorProcessor(handler ZipkinCollector) *ZipkinCollectorProcessor
func (*ZipkinCollectorProcessor) AddToProcessorMap ¶
func (p *ZipkinCollectorProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
func (*ZipkinCollectorProcessor) GetProcessorFunction ¶
func (p *ZipkinCollectorProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
func (*ZipkinCollectorProcessor) Process ¶
func (p *ZipkinCollectorProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
func (*ZipkinCollectorProcessor) ProcessorMap ¶
func (p *ZipkinCollectorProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
type ZipkinCollectorSubmitZipkinBatchArgs ¶
type ZipkinCollectorSubmitZipkinBatchArgs struct {
Spans []*Span `thrift:"spans,1" db:"spans" json:"spans"`
}
Attributes:
- Spans
func NewZipkinCollectorSubmitZipkinBatchArgs ¶
func NewZipkinCollectorSubmitZipkinBatchArgs() *ZipkinCollectorSubmitZipkinBatchArgs
func (*ZipkinCollectorSubmitZipkinBatchArgs) GetSpans ¶
func (p *ZipkinCollectorSubmitZipkinBatchArgs) GetSpans() []*Span
func (*ZipkinCollectorSubmitZipkinBatchArgs) ReadField1 ¶ added in v1.19.0
func (*ZipkinCollectorSubmitZipkinBatchArgs) String ¶
func (p *ZipkinCollectorSubmitZipkinBatchArgs) String() string
type ZipkinCollectorSubmitZipkinBatchResult ¶
type ZipkinCollectorSubmitZipkinBatchResult struct {
Success []*Response `thrift:"success,0" db:"success" json:"success,omitempty"`
}
Attributes:
- Success
func NewZipkinCollectorSubmitZipkinBatchResult ¶
func NewZipkinCollectorSubmitZipkinBatchResult() *ZipkinCollectorSubmitZipkinBatchResult
func (*ZipkinCollectorSubmitZipkinBatchResult) GetSuccess ¶
func (p *ZipkinCollectorSubmitZipkinBatchResult) GetSuccess() []*Response
func (*ZipkinCollectorSubmitZipkinBatchResult) IsSetSuccess ¶
func (p *ZipkinCollectorSubmitZipkinBatchResult) IsSetSuccess() bool
func (*ZipkinCollectorSubmitZipkinBatchResult) ReadField0 ¶ added in v1.19.0
func (*ZipkinCollectorSubmitZipkinBatchResult) String ¶
func (p *ZipkinCollectorSubmitZipkinBatchResult) String() string