extensions

package
v2.0.0-RC3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 14

Documentation

Overview

Package extensions provides implementations of common event extensions.

Index

Constants

View Source
const (
	TraceParentExtension = "traceparent"
	TraceStateExtension  = "tracestate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedTracingExtension

type DistributedTracingExtension struct {
	TraceParent string `json:"traceparent"`
	TraceState  string `json:"tracestate"`
}

DistributedTracingExtension represents the extension for cloudevents context

func FromSpanContext

func FromSpanContext(sc trace.SpanContext) DistributedTracingExtension

FromSpanContext populates DistributedTracingExtension from a SpanContext.

func GetDistributedTracingExtension

func GetDistributedTracingExtension(event event.Event) (DistributedTracingExtension, bool)

func (DistributedTracingExtension) AddTracingAttributes

func (d DistributedTracingExtension) AddTracingAttributes(e event.EventWriter)

AddTracingAttributes adds the tracing attributes traceparent and tracestate to the cloudevents context

func (*DistributedTracingExtension) ReadTransformer

func (DistributedTracingExtension) StartChildSpan

func (d DistributedTracingExtension) StartChildSpan(ctx context.Context, name string, opts ...trace.StartOption) (context.Context, *trace.Span)

func (DistributedTracingExtension) ToSpanContext

func (d DistributedTracingExtension) ToSpanContext() (trace.SpanContext, error)

ToSpanContext creates a SpanContext from a DistributedTracingExtension instance.

func (*DistributedTracingExtension) WriteTransformer

func (d *DistributedTracingExtension) WriteTransformer() binding.TransformerFunc

Jump to

Keyboard shortcuts

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