gintracing

package module
v0.0.0-...-2ed380a Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: MIT Imports: 4 Imported by: 0

README

gintracing

Go Report Card GoDoc

NOTE: Development moved to repo in gin-contrib

Package gintracing provides requests tracing functional using opentracing specification.

Download:

go get github.com/containerum/gintracing

Package gintracing provides requests tracing functional using opentracing specification.

See https://github.com/opentracing/opentracing-go for more information

TODO
  • add code sample

Automatically generated by autoreadme on 2017.12.01

Documentation

Overview

Package gintracing provides requests tracing functional using opentracing specification.

See https://github.com/opentracing/opentracing-go for more information

Index

Constants

This section is empty.

Variables

View Source
var AbortOnErrors = false

AbortOnErrors determines middleware behavior on errors. If set to true middleware aborts request with http.InternalServerError.

View Source
var ErrSpanNotFound = errors.New("span was not found in context")

Functions

func NewSpan

func NewSpan(tracer opentracing.Tracer, operationName string, opts ...opentracing.StartSpanOption) gin.HandlerFunc

NewSpan returns gin.HandlerFunc (middleware) that starts a new span and injects it to request context.

It calls ctx.Next() to measure execution time of all following handlers.

func SpanFromContext

func SpanFromContext(tracer opentracing.Tracer, operationName string,
	advancedOpts ...opentracing.StartSpanOption) gin.HandlerFunc

SpanFromContext returns gin.HandlerFunc (middleware) that extracts parent span from request context and starts a new span as child of parent span.

It calls ctx.Next() to measure execution time of all following handlers.

func SpanFromHeaders

func SpanFromHeaders(tracer opentracing.Tracer, operationName string,
	psr ParentSpanReferenceFunc, advancedOpts ...opentracing.StartSpanOption) gin.HandlerFunc

SpanFromHeaders returns gin.HandlerFunc (middleware) that extracts parent span data from HTTP headers and starts a new span referenced to parent with ParentSpanReferenceFunc.

It calls ctx.Next() to measure execution time of all following handlers.

Types

type ParentSpanReferenceFunc

type ParentSpanReferenceFunc func(opentracing.SpanContext) opentracing.StartSpanOption

ParentSpanReferenceFunc determines how to reference parent span

See opentracing.SpanReferenceType

Jump to

Keyboard shortcuts

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