spanutils

package
Version: v0.0.0-...-032e02f Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

README

spanutils

import "github.com/carousell/Orion/utils/spanutils"

Overview

Imported Packages

Index

Package files

spanutils.go

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 GRPCTracingSpan

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

type TracingSpan

type TracingSpan interface {
    End()
    Finish()
    SetTag(key string, value interface{})
    SetQuery(query string)
    SetError(msg string)
}

TracingSpan defines an interface for implementing a tracing span

func NewDatastoreSpan
func NewDatastoreSpan(ctx context.Context, name string, datastore string) (TracingSpan, context.Context)

NewDatastoreSpan starts a span for tracing data store actions

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

NewExternalSpan starts a span for tracing external actions

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

NewHTTPExternalSpan starts a span for tracing external HTTP actions

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

NewInternalSpan starts a span for tracing internal actions


Generated by godoc2ghmd

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 GRPCTracingSpan

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

Types

type TracingSpan

type TracingSpan interface {
	End()
	Finish()
	SetTag(key string, value interface{})
	SetQuery(query string)
	SetError(msg string)
}

TracingSpan defines an interface for implementing a tracing span

func NewDatastoreSpan

func NewDatastoreSpan(ctx context.Context, name string, datastore string) (TracingSpan, context.Context)

NewDatastoreSpan starts a span for tracing data store actions

func NewExternalSpan

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

NewExternalSpan starts a span for tracing external actions

func NewHTTPExternalSpan

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

NewHTTPExternalSpan starts a span for tracing external HTTP actions

func NewInternalSpan

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

NewInternalSpan starts a span for tracing internal actions

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL