internal

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SpanStatusFromHTTPStatusCode

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

SpanStatusFromHTTPStatusCode generates a status code and a message as specified by the OpenTelemetry specification for a span.

func SpanStatusFromHTTPStatusCodeAndSpanKind

func SpanStatusFromHTTPStatusCodeAndSpanKind(code int, spanKind trace.SpanKind) (codes.Code, string)

SpanStatusFromHTTPStatusCodeAndSpanKind generates a status code and a message as specified by the OpenTelemetry specification for a span. Exclude 4xx for SERVER to set the appropriate status.

Types

type SemanticConventions

type SemanticConventions struct {
	EnduserIDKey                attribute.Key
	HTTPClientIPKey             attribute.Key
	HTTPFlavorKey               attribute.Key
	HTTPHostKey                 attribute.Key
	HTTPMethodKey               attribute.Key
	HTTPRequestContentLengthKey attribute.Key
	HTTPRouteKey                attribute.Key
	HTTPSchemeHTTP              attribute.KeyValue
	HTTPSchemeHTTPS             attribute.KeyValue
	HTTPServerNameKey           attribute.Key
	HTTPStatusCodeKey           attribute.Key
	HTTPTargetKey               attribute.Key
	HTTPURLKey                  attribute.Key
	HTTPUserAgentKey            attribute.Key
	NetHostIPKey                attribute.Key
	NetHostNameKey              attribute.Key
	NetHostPortKey              attribute.Key
	NetPeerIPKey                attribute.Key
	NetPeerNameKey              attribute.Key
	NetPeerPortKey              attribute.Key
	NetTransportIP              attribute.KeyValue
	NetTransportOther           attribute.KeyValue
	NetTransportTCP             attribute.KeyValue
	NetTransportUDP             attribute.KeyValue
	NetTransportUnix            attribute.KeyValue
}

SemanticConventions are the semantic convention values defined for a version of the OpenTelemetry specification.

func (*SemanticConventions) EndUserAttributesFromHTTPRequest

func (sc *SemanticConventions) EndUserAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue

EndUserAttributesFromHTTPRequest generates attributes of the enduser namespace as specified by the OpenTelemetry specification for a span.

func (*SemanticConventions) HTTPAttributesFromHTTPStatusCode

func (sc *SemanticConventions) HTTPAttributesFromHTTPStatusCode(code int) []attribute.KeyValue

HTTPAttributesFromHTTPStatusCode generates attributes of the http namespace as specified by the OpenTelemetry specification for a span.

func (*SemanticConventions) HTTPClientAttributesFromHTTPRequest

func (sc *SemanticConventions) HTTPClientAttributesFromHTTPRequest(request *http.Request) []attribute.KeyValue

HTTPClientAttributesFromHTTPRequest generates attributes of the http namespace as specified by the OpenTelemetry specification for a span on the client side.

func (*SemanticConventions) HTTPServerAttributesFromHTTPRequest

func (sc *SemanticConventions) HTTPServerAttributesFromHTTPRequest(serverName, route string, request *http.Request) []attribute.KeyValue

HTTPServerAttributesFromHTTPRequest generates attributes of the http namespace as specified by the OpenTelemetry specification for a span on the server side. Currently, only basic authentication is supported.

func (*SemanticConventions) HTTPServerMetricAttributesFromHTTPRequest

func (sc *SemanticConventions) HTTPServerMetricAttributesFromHTTPRequest(serverName string, request *http.Request) []attribute.KeyValue

HTTPServerMetricAttributesFromHTTPRequest generates low-cardinality attributes to be used with server-side HTTP metrics.

func (*SemanticConventions) NetAttributesFromHTTPRequest

func (sc *SemanticConventions) NetAttributesFromHTTPRequest(network string, request *http.Request) []attribute.KeyValue

NetAttributesFromHTTPRequest generates attributes of the net namespace as specified by the OpenTelemetry specification for a span. The network parameter is a string that net.Dial function from standard library can understand.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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