semconvutil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkFamilyIPv4 = "inet"
	NetworkFamilyIPv6 = "inet6"
	NetworkFamilyUnix = "unix"
)

Variables

This section is empty.

Functions

func HTTPClientRequest

func HTTPClientRequest(req *http.Request) []attribute.KeyValue

ClientRequest returns attributes for an HTTP request sent by client.

The following attributes are always returned: "http.request.method", "url.scheme", "url.full", "server.address", "network.protocol.name", "network.protocol.version", "network.transport". The following attributes are returned if they related values are defined in req: "server.port", "user_agent.original".

func HTTPClientResponse

func HTTPClientResponse(resp *http.Response) []attribute.KeyValue

ClientResponse returns attributes for an HTTP response received by client.

The following attributes are always returned: "http.response.status_code".

func HTTPServerRequest

func HTTPServerRequest(ctx *azugo.Context) []attribute.KeyValue

HTTPServerRequest returns trace attributes for an HTTP request received by a server.

The server must be the primary server name if it is known. For example this would be the ServerName directive (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache server, and the server_name directive (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an nginx server. More generically, the primary server name would be the host header value that matches the default virtual host of an HTTP server. It should include the host identifier and if a port is used to route to the server that port identifier should be included as an appropriate port suffix.

If the primary server name is not known, server should be an empty string. The req Host will be used to determine the server instead.

The following attributes are always returned: "http.request.method", "url.scheme", "url.path", "url.full", "server.address". The following attributes are returned if they related values are defined in req: "server.port", "network.peer.address", "network.peer.port", "user_agent.original", "client.address", "network.protocol.name", "network.protocol.version".

func HTTPServerStatus

func HTTPServerStatus(code int) (codes.Code, string)

HTTPServerStatus returns a span status code and message for an HTTP status code value returned by a server. Status codes in the 400-499 range are not returned as errors.

func NetTransport

func NetTransport(network string) attribute.KeyValue

NetTransport returns a trace attribute describing the transport protocol of the passed network. See the net.Dial for information about acceptable network values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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