gintrace

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package gintrace provides tracing middleware for the Gin web framework.

Example

To start tracing requests, add the trace middleware to your Gin router.

Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTML

func HTML(c *gin.Context, code int, name string, obj interface{})

HTML will trace the rendering of the template as a child of the span in the given context.

Example
Output:

func Middleware

func Middleware(service string) gin.HandlerFunc

Middleware returns middleware that will trace requests with the default tracer.

func MiddlewareTracer

func MiddlewareTracer(service string, t *tracer.Tracer) gin.HandlerFunc

MiddlewareTracer returns middleware that will trace requests with the given tracer.

func NewChildSpan

func NewChildSpan(name string, c *gin.Context) *tracer.Span

NewChildSpan will create a span that is the child of the span stored in the context.

func Span

func Span(c *gin.Context) (*tracer.Span, bool)

Span returns the Span stored in the given Context and true. If it doesn't exist, it will returns (nil, false)

func SpanDefault

func SpanDefault(c *gin.Context) *tracer.Span

SpanDefault returns the span stored in the given Context. If none exists, it will return an empty span.

Example
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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