Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentLibrary ¶ added in v0.1.1
type ComponentLibrary int32
ComponentLibrary represents a specific library or component where the current span is running. This type helps identify the origin of the span within SkyWalking's tracing UI, making it easier to debug and understand distributed traces.
Each library or component is associated with a unique identifier that is displayed in the SkyWalking UI. These identifiers allow developers to distinguish between various technologies in use within their traced application.
A complete list of available component libraries and their IDs can be found in the SkyWalking repository: https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml
const ( Unknown ComponentLibrary = 0 GoRedis ComponentLibrary = 7 PostgreSQL ComponentLibrary = 22 GoKafka ComponentLibrary = 27 RabbitMQ ComponentLibrary = 51 GoHttpServer ComponentLibrary = 5004 GoMysql ComponentLibrary = 5012 )
func (ComponentLibrary) AsInt32 ¶ added in v0.1.1
func (c ComponentLibrary) AsInt32() int32
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span represents a unit of work in a distributed trace.
A span captures timing, metadata, and contextual information about a specific operation within a trace. This struct provides abstraction over the underlying SkyWalking `go2sky.Span`, enabling more intuitive interaction and additional functionality.
func (*Span) Context ¶
func (s *Span) Context() tengcoruxTracer.SpanContext
Context returns SpanContext.
func (*Span) RecordError ¶
RecordError records an error to the current span at current timeframe.
func (*Span) SetAttributes ¶
SetAttributes sets attributes to the current span.
type SpanContext ¶
type SpanContext struct {
// contains filtered or unexported fields
}
SpanContext is a wrapper around a Go context for which it stores the underlying context of a span. It provides convenient methods for interacting with tracing information. The SpanContext is designed to be used wherever tracing context needs to be passed or extracted within an application.
func (*SpanContext) Context ¶
func (sc *SpanContext) Context() context.Context
Context returns the SpanContext's underlying context.
func (*SpanContext) SpanID ¶
func (sc *SpanContext) SpanID() string
SpanID returns the SpanContext's SpanID. If it does not exist then it returns an empty string.
func (*SpanContext) TraceID ¶
func (sc *SpanContext) TraceID() string
TraceID returns the SpanContext's TraceID. If it does not exist then it returns an empty string.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func NewTracer ¶
func NewTracer(exportAddr, serviceName string, opts ...go2sky.TracerOption) (*Tracer, error)
func (*Tracer) SpanFromContext ¶
func (t *Tracer) SpanFromContext(ctx context.Context) tengcoruxTracer.Span
func (*Tracer) StartSpan ¶
func (t *Tracer) StartSpan(ctx context.Context, name string, opts ...tengcoruxTracer.StartSpanOption) (context.Context, tengcoruxTracer.Span)