package module
Version: v0.11.0 Latest Latest

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 5 Imported by: 0



Package go-restful provides functions to trace the emicklei/go-restful/v3 package (

Instrumentation of an incoming request is achieved via a go-restful FilterFunc called `OTelFilterFunc` which may be applied at any one of

  • the container level
  • webservice level
  • route level



This section is empty.


This section is empty.


func OTelFilter

func OTelFilter(service string, opts ...Option) restful.FilterFunction

OTelFilter returns a restful.FilterFunction which will trace an incoming request.

The service parameter should describe the name of the (virtual) server handling the request. Options can be applied to configure the tracer and propagators used for this filter.


type Config

type Config struct {
	Tracer      oteltrace.Tracer
	Propagators otelpropagation.Propagators

Config is used to configure the go-restful middleware.

type Option

type Option func(*Config)

Option specifies instrumentation configuration options.

func WithPropagators

func WithPropagators(propagators otelpropagation.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 oteltrace.Tracer) Option

WithTracer specifies a tracer to use for creating spans. If none is specified, a tracer named "" from the global provider is used.


Path Synopsis
otelrestful module
example Module
test Module

Jump to

Keyboard shortcuts

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