tracing

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

README

GoDoc

tracing

import "github.com/go-coldbrew/tracing"

Index

func ClientSpan

func ClientSpan(operationName string, ctx context.Context) (context.Context, opentracing.Span)

ClientSpan starts a new client span linked to the existing spans if any are found

func CloneContextValues

func CloneContextValues(parent context.Context) context.Context

CloneContextValues clones a given context values and returns a new context obj which is not affected by Cancel, Deadline etc

func GRPCTracingSpan

func GRPCTracingSpan(operationName string, ctx context.Context) context.Context

func MergeContextValues

func MergeContextValues(parent context.Context, main context.Context) context.Context

MergeContextValues merged the given main context with a parent conetext, Cancel/Deadline etc are used from the main context and values are look in both the context

type Span

Span defines an interface for implementing a tracing span

type Span interface {
    End()
    Finish()
    SetTag(key string, value interface{})
    SetQuery(query string)
    SetError(err error) error
}
func NewDatastoreSpan
func NewDatastoreSpan(ctx context.Context, datastore, operation, collection string) (Span, context.Context)

NewDatastoreSpan starts a span for tracing data store actions

func NewExternalSpan
func NewExternalSpan(ctx context.Context, name string, url string) (Span, context.Context)

NewExternalSpan starts a span for tracing external actions

func NewHTTPExternalSpan
func NewHTTPExternalSpan(ctx context.Context, name string, url string, hdr http.Header) (Span, context.Context)

NewHTTPExternalSpan starts a span for tracing external HTTP actions

func NewInternalSpan
func NewInternalSpan(ctx context.Context, name string) (Span, context.Context)

NewInternalSpan starts a span for tracing internal actions

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientSpan

func ClientSpan(operationName string, ctx context.Context) (context.Context, opentracing.Span)

ClientSpan starts a new client span linked to the existing spans if any are found

func CloneContextValues

func CloneContextValues(parent context.Context) context.Context

CloneContextValues clones a given context values and returns a new context obj which is not affected by Cancel, Deadline etc

func GRPCTracingSpan

func GRPCTracingSpan(operationName string, ctx context.Context) context.Context

func MergeContextValues

func MergeContextValues(parent context.Context, main context.Context) context.Context

MergeContextValues merged the given main context with a parent conetext, Cancel/Deadline etc are used from the main context and values are look in both the context

Types

type Span

type Span interface {
	End()
	Finish()
	SetTag(key string, value interface{})
	SetQuery(query string)
	SetError(err error) error
}

Span defines an interface for implementing a tracing span

func NewDatastoreSpan

func NewDatastoreSpan(ctx context.Context, datastore, operation, collection string) (Span, context.Context)

NewDatastoreSpan starts a span for tracing data store actions

func NewExternalSpan

func NewExternalSpan(ctx context.Context, name string, url string) (Span, context.Context)

NewExternalSpan starts a span for tracing external actions

func NewHTTPExternalSpan

func NewHTTPExternalSpan(ctx context.Context, name string, url string, hdr http.Header) (Span, context.Context)

NewHTTPExternalSpan starts a span for tracing external HTTP actions

func NewInternalSpan

func NewInternalSpan(ctx context.Context, name string) (Span, context.Context)

NewInternalSpan starts a span for tracing internal actions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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