Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

internal

v1.47.0
go.opentelemetry.io/otel/semconv/internal

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

11 matches

Top ↑

Package internal provides common semconv functionality.

Functions

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.

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

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.

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.

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.

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.

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.

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.

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.

Dependency graph