otelchi

package module
v0.0.0-...-2594140 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

otelchi

OpenTelemetry instrumentation for go-chi/chi.

Why not provided this instrumentation from official repository?

open-telemetry/opentelemetry-go-contrib

According to our new instrumentation policy, we are no longer accepting new instrumentation to the project as we do not have the developer bandwidth to support it.

Usage

Install

$ go get github.com/yacchi/otelchi

Integration

TODO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(service string, opts ...Option) func(http.Handler) http.Handler

Middleware sets up a handler to start tracing the incoming requests. The service parameter should describe the name of the (virtual) server handling the request.

Types

type Option

type Option func(*config)

Option specifies instrumentation configuration options.

func WithFilter

func WithFilter(f otelhttp.Filter) Option

WithFilter adds a filter to the list of filters used by the handler. If any filter indicates to exclude a request then the request will not be traced. All filters must allow a request to be traced for a Span to be created. If no filters are provided then all requests are traced. Filters will be invoked for each processed request, it is advised to make them simple and fast.

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.

func WithTracerProvider

func WithTracerProvider(provider oteltrace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

Jump to

Keyboard shortcuts

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