gorilla

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gorilla provides OpenTracing instrumentation for the gorilla package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(tr opentracing.Tracer, h http.Handler, options ...nethttp.MWOption) http.Handler

Middleware wraps an http.Handler and traces incoming requests. Additionally, it adds the span to the request's context.

By default, the operation name of the spans is set to "HTTP {method}". This can be overriden with options.

The options allow fine tuning the behavior of the middleware.

Example:

pattern := "/api/custerms/{id}"
mw := gorilla.Middleware(
   tracer,
   handler,
)
r := mux.NewRouter()
r.HandleFunc(pattern, mw)

Types

This section is empty.

Jump to

Keyboard shortcuts

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