ocmux

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 4 Imported by: 7

README

Gorilla Mux integration for Open Census

CircleCI Go Report Card GolangCI Go Version GoDoc

Installation

$ go get github.com/sagikazarmark/ocmux

Usage

package main

import (
	"github.com/gorilla/mux"
	"github.com/sagikazarmark/ocmux"
)

func main() {
	router := mux.NewRouter()
	router.Use(ocmux.Middleware())
}

Attribution

Based on the work of @basvanbeek: https://github.com/basvanbeek/opencensus-gorilla_mux-example

Removed some Zipkin specific code, added a few features.

License

The MIT License (MIT). Please see License File for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware() mux.MiddlewareFunc

Middleware holds a Gorilla Mux middleware to update the OpenCensus span name and the http route tag. It uses the configured route name (if any), otherwise falls back to the request method and the path template. This is typically used in a HTTP server using Gorilla Mux for routing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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