traceio

package
v0.5.49 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Trace attribute keys for various Service Weaver identifiers. These
	// are attached to all exported traces by the weavelet, and displayed
	// in the UI by the Service Weaver visualization tools (e.g., dashboard).
	AppTraceKey          = attribute.Key("serviceweaver.app")
	DeploymentIdTraceKey = attribute.Key("serviceweaver.deployment_id")
	WeaveletIdTraceKey   = attribute.Key("serviceweaver.weavelet_id")
)
View Source
const (
	// Interval at which traces are exported.
	ExportInterval = 5 * time.Second
)

Variables

This section is empty.

Functions

func TestTracer

func TestTracer() trace.Tracer

TestTracer returns a simple tracer suitable for tests.

Types

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer writes a sequence of trace spans to a specified export function.

func NewWriter

func NewWriter(export func(spans *protos.TraceSpans) error) *Writer

NewWriter creates a Writer that writes a sequence of trace spans to a specified export function.

func (*Writer) ExportSpans

func (w *Writer) ExportSpans(_ context.Context, spans []sdk.ReadOnlySpan) error

ExportSpans implements the sdk.SpanExporter interface.

func (*Writer) ExportSpansProto

func (w *Writer) ExportSpansProto(spans *protos.TraceSpans) error

ExportSpansProto is like ExportSpans, but it exports spans in the *protos.TraceSpans format.

func (*Writer) Shutdown

func (w *Writer) Shutdown(_ context.Context) error

Shutdown implements the sdk.SpanExporter interface.

Jump to

Keyboard shortcuts

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