httptrace

package
v1.999.0-beta.15 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package httptrace provides functionalities to trace HTTP requests that are commonly required and used across contrib/** integrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinishRequestSpan

func FinishRequestSpan(s tracer.Span, status int, opts ...tracer.FinishOption)

FinishRequestSpan finishes the given HTTP request span and sets the expected response-related tags such as the status code. Any further span finish option can be added with opts.

func GetErrorCodesFromInput added in v1.69.0

func GetErrorCodesFromInput(s string) func(statusCode int) bool

GetErrorCodesFromInput parses a comma-separated string s to determine which codes are to be considered errors Its purpose is to support the DD_TRACE_HTTP_SERVER_ERROR_STATUSES env var If error condition cannot be determined from s, `nil` is returned e.g, input of "100,200,300-400" returns a function that returns true on 100, 200, and all values between 300-400, inclusive any input that cannot be translated to integer values returns nil

func HeaderTagsFromRequest added in v1.53.0

func HeaderTagsFromRequest(req *http.Request, headerCfg instrumentation.HeaderTags) ddtrace.StartSpanOption

HeaderTagsFromRequest matches req headers to user-defined list of header tags and creates span tags based on the header tag target and the req header value

func StartRequestSpan

func StartRequestSpan(r *http.Request, opts ...ddtrace.StartSpanOption) (tracer.Span, context.Context)

StartRequestSpan starts an HTTP request span with the standard list of HTTP request span tags (http.method, http.url, http.useragent). Any further span start option can be added with opts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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