Documentation

Overview

Package macaron provides functions to trace the macaron.v1 package (https://github.com/go-macaron/macaron).

Currently only the routing of a received message can be instrumented. To do it, use the Middleware function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

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

Middleware returns a macaron Handler to trace requests to the server.

Types

type Config

type Config struct {
	Tracer      trace.Tracer
	Propagators propagation.Propagators
}

Config is a helper struct to configure Macaron options

type Option

type Option func(*Config)

Option specifies instrumentation configuration options.

func WithPropagators

func WithPropagators(propagators propagation.Propagators) Option

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

func WithTracer

func WithTracer(tracer trace.Tracer) Option

WithTracer specifies a tracer to use for creating spans. If none is specified, a tracer named "go.opentelemetry.io/contrib/instrumentation/macaron" from the global provider is used.

Directories

Path Synopsis