Documentation

Overview

    Package chi provides tracing functions for tracing the go-chi/chi package (https://github.com/go-chi/chi).

    Example
    Output:
    
    
    Example (WithServiceName)
    Output:
    
    

    Index

    Examples

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func Middleware

    func Middleware(opts ...Option) func(next http.Handler) http.Handler

      Middleware returns middleware that will trace incoming requests.

      Types

      type Option

      type Option func(*config)

        Option represents an option that can be passed to NewRouter.

        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 given service name for the router.

              func WithSpanOptions

              func WithSpanOptions(opts ...ddtrace.StartSpanOption) Option

                WithSpanOptions applies the given set of options to the spans started by the router.

                func WithStatusCheck

                func WithStatusCheck(fn func(statusCode int) bool) Option

                  WithStatusCheck specifies a function fn which reports whether the passed statusCode should be considered an error.

                  Source Files