Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RemoteIPTag is the tag name used for the remote HTTP request IP address. RemoteIPTag = "network.client.ip" // ClientIPTag is the tag name used for the client IP deduced from the HTTP // request headers with ClientIP(). ClientIPTag = "http.client_ip" )
Variables ¶
This section is empty.
Functions ¶
func ClientIP ¶
func ClientIP(hdrs map[string][]string, hasCanonicalHeaders bool, remoteAddr string, monitoredHeaders []string) (remoteIP, clientIP netip.Addr)
ClientIP returns the first public IP address found in the given headers. If none is present, it returns the first valid IP address present, possibly being a local IP address. The remote address, when valid, is used as fallback when no IP address has been found at all.
func ClientIPTags ¶
ClientIPTags returns the resulting Datadog span tags `http.client_ip` containing the client IP and `network.client.ip` containing the remote IP. The tags are present only if a valid ip address has been returned by ClientIP().
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.