tracing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AttributeMessageUUID       attribute.Key = "orb.messageUUID"
	AttributeActivityID        attribute.Key = "orb.activityID"
	AttributeActivityType      attribute.Key = "orb.activityType"
	AttributeOutboxMessageType attribute.Key = "orb.outboxMessageType"
	AttributeAnchorEventURI    attribute.Key = "orb.anchorEventURI"
	AttributeDIDSuffix         attribute.Key = "orb.didSuffix"
)

Tracing attributes.

Variables

This section is empty.

Functions

func ActivityIDAttribute

func ActivityIDAttribute(value string) attribute.KeyValue

ActivityIDAttribute returns the orb.activityID tracing attribute.

func ActivityTypeAttribute

func ActivityTypeAttribute(value string) attribute.KeyValue

ActivityTypeAttribute returns the orb.activityType tracing attribute.

func AnchorEventURIAttribute

func AnchorEventURIAttribute(value string) attribute.KeyValue

AnchorEventURIAttribute returns the orb.anchorEventURI tracing attribute.

func DIDSuffixAttribute

func DIDSuffixAttribute(value string) attribute.KeyValue

DIDSuffixAttribute returns the orb.didSuffix tracing attribute.

func MessageUUIDAttribute

func MessageUUIDAttribute(value string) attribute.KeyValue

MessageUUIDAttribute returns the orb.messageUUID tracing attribute.

func OutboxMessageTypeAttribute

func OutboxMessageTypeAttribute(value string) attribute.KeyValue

OutboxMessageTypeAttribute returns the orb.outboxMessageType tracing attribute.

func Tracer

func Tracer(subsystem Subsystem) trace.Tracer

Tracer returns a tracer for the given subsystem.

Types

type Provider

type Provider interface {
	trace.TracerProvider

	Start()
	Stop()
}

Provider creates tracers.

func Initialize

func Initialize(provider, serviceName, url string) (Provider, error)

Initialize creates and registers globally a new tracer Provider.

type ProviderType

type ProviderType = string

ProviderType specifies the type of the tracer provider.

const (
	// ProviderNone indicates that tracing is disabled.
	ProviderNone ProviderType = ""
	// ProviderJaeger indicates that tracing data should be in Jaeger format.
	ProviderJaeger ProviderType = "JAEGER"
)

type Span

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

Span is a wrapper around a trace.Span that ensures it is started only once and ended only if it was started.

func NewSpan

func NewSpan(tracer trace.Tracer, ctx context.Context) *Span

NewSpan returns a Span wrapper.

func (*Span) End

func (s *Span) End(opts ...trace.SpanEndOption)

End ends the span if it had been started.

func (*Span) Start

func (s *Span) Start(name string, opts ...trace.SpanStartOption) context.Context

Start starts a span if it hasn't already been started.

type Subsystem

type Subsystem string

Subsystem defines an Orb subsystem.

const (
	SubsystemActivityPub    Subsystem = "activitypub"
	SubsystemAnchor         Subsystem = "anchor"
	SubsystemDocument       Subsystem = "document"
	SubsystemOperationQueue Subsystem = "context/opqueue"
	SubsystemAMQP           Subsystem = "pubsub/amqp"
)

Subsystems.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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