Documentation

Overview

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

    Example

      To start tracing requests, add the trace filter to your go-restful router.

      Output:
      
      
      Example (SpanFromContext)
      Output:
      
      

      Index

      Examples

      Constants

      This section is empty.

      Variables

      This section is empty.

      Functions

      func Filter

      func Filter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

        Filter is deprecated. Please use FilterFunc.

        func FilterFunc

        func FilterFunc(configOpts ...Option) restful.FilterFunction

          FilterFunc returns a restful.FilterFunction which will automatically trace incoming request.

          Types

          type Option

          type Option func(*config)

            Option specifies instrumentation configuration options.

            func WithAnalytics

            func WithAnalytics(on bool) Option

              WithAnalytics enables Trace Analytics for all started spans.

              func WithAnalyticsRate

              func WithAnalyticsRate(rate float64) Option

                WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.

                func WithServiceName

                func WithServiceName(name string) Option

                  WithServiceName sets the service name to by used by the filter.