tracing

package
v0.0.0-...-88fc132 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	StatusOK    = "OK"
	StatusError = "Error"
	StatusUnset = "Unset"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceInfo

type ResourceInfo struct {
	ServiceName    string `json:"service.name"`
	ServiceVersion string `json:"service.version"`
}

type Span

type Span struct {
	SpanID       string            `json:"spanId"`
	ParentSpanID *string           `json:"parentSpanId,omitempty"`
	Name         string            `json:"name"`
	Kind         string            `json:"kind"`
	StartTime    time.Time         `json:"startTime"`
	EndTime      time.Time         `json:"endTime"`
	Attributes   map[string]string `json:"attributes"`
	Status       SpanStatus        `json:"status"`
}

func NewSpan

func NewSpan(name, kind string, parentID *string, startTime, endTime time.Time) Span

func (*Span) OnDone

func (s *Span) OnDone()

func (*Span) SetStatus

func (s *Span) SetStatus(err error)

SetStatus updates the status of the span based on the provided error.

func (*Span) SetStatusFromHTTPCode

func (s *Span) SetStatusFromHTTPCode(code int)

SetStatusFromHTTPCode updates the span's status based on the HTTP response code.

func (*Span) WithAttributes

func (s *Span) WithAttributes(attrs map[string]string) *Span

type SpanStatus

type SpanStatus struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Trace

type Trace struct {
	TraceID  string        `json:"traceId"`
	Spans    []*Span       `json:"spans"`
	Resource *ResourceInfo `json:"resource"`
}

func NewTrace

func NewTrace(serviceName, serviceVersion string) *Trace

func (*Trace) Append

func (t *Trace) Append(span ...*Span)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL