Search and commands

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

Type to search packages.

httpconv

v1.47.0
go.opentelemetry.io/otel/semconv/v1.33.0/httpconv

Documentation

pkg.go.dev ↗

Table of contents

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

143 matches

Top ↑

Package httpconv provides types and functionality for OpenTelemetry semantic conventions in the "http" namespace.

Types

ClientActiveRequests

type ClientActiveRequests struct {
	metric.Int64UpDownCounter
}

ClientActiveRequests is an instrument used to record metric values conforming to the "http.client.active_requests" semantic conventions. It represents the number of active HTTP requests.

NewClientActiveRequests

func NewClientActiveRequests(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (ClientActiveRequests, error)

NewClientActiveRequests returns a new ClientActiveRequests instrument.

ClientActiveRequests.Add

func (m ClientActiveRequests) Add(
	ctx context.Context,
	incr int64,
	serverAddress string,
	serverPort int,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

The serverAddress is the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

The serverPort is the port identifier of the "URI origin" HTTP request is sent to.

All additional attrs passed are included in the recorded value.

ClientActiveRequests.AttrRequestMethod

func (ClientActiveRequests) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue

AttrRequestMethod returns an optional attribute for the "http.request.method" semantic convention. It represents the HTTP request method.

ClientActiveRequests.AttrURLScheme

func (ClientActiveRequests) AttrURLScheme(val string) attribute.KeyValue

AttrURLScheme returns an optional attribute for the "url.scheme" semantic convention. It represents the URI scheme component identifying the used protocol.

ClientActiveRequests.AttrURLTemplate

func (ClientActiveRequests) AttrURLTemplate(val string) attribute.KeyValue

AttrURLTemplate returns an optional attribute for the "url.template" semantic convention. It represents the low-cardinality template of an absolute path reference.

ClientActiveRequests.Description

func (ClientActiveRequests) Description() string

Description returns the semantic convention description of the instrument

ClientActiveRequests.Inst

func (m ClientActiveRequests) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

ClientActiveRequests.Name

func (ClientActiveRequests) Name() string

Name returns the semantic convention name of the instrument.

ClientActiveRequests.Unit

func (ClientActiveRequests) Unit() string

Unit returns the semantic convention unit of the instrument

ClientConnectionDuration

type ClientConnectionDuration struct {
	metric.Float64Histogram
}

ClientConnectionDuration is an instrument used to record metric values conforming to the "http.client.connection.duration" semantic conventions. It represents the duration of the successfully established outbound HTTP connections.

NewClientConnectionDuration

func NewClientConnectionDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ClientConnectionDuration, error)

NewClientConnectionDuration returns a new ClientConnectionDuration instrument.

ClientConnectionDuration.AttrNetworkPeerAddress

func (ClientConnectionDuration) AttrNetworkPeerAddress(val string) attribute.KeyValue

AttrNetworkPeerAddress returns an optional attribute for the "network.peer.address" semantic convention. It represents the peer address of the network connection - IP address or Unix domain socket name.

ClientConnectionDuration.AttrNetworkProtocolVersion

func (ClientConnectionDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ClientConnectionDuration.AttrURLScheme

func (ClientConnectionDuration) AttrURLScheme(val string) attribute.KeyValue

AttrURLScheme returns an optional attribute for the "url.scheme" semantic convention. It represents the URI scheme component identifying the used protocol.

ClientConnectionDuration.Description

func (ClientConnectionDuration) Description() string

Description returns the semantic convention description of the instrument

ClientConnectionDuration.Inst

func (m ClientConnectionDuration) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

ClientConnectionDuration.Name

func (ClientConnectionDuration) Name() string

Name returns the semantic convention name of the instrument.

ClientConnectionDuration.Record

func (m ClientConnectionDuration) Record(
	ctx context.Context,
	val float64,
	serverAddress string,
	serverPort int,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The serverAddress is the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

The serverPort is the port identifier of the "URI origin" HTTP request is sent to.

All additional attrs passed are included in the recorded value.

ClientConnectionDuration.Unit

func (ClientConnectionDuration) Unit() string

Unit returns the semantic convention unit of the instrument

ClientOpenConnections

type ClientOpenConnections struct {
	metric.Int64UpDownCounter
}

ClientOpenConnections is an instrument used to record metric values conforming to the "http.client.open_connections" semantic conventions. It represents the number of outbound HTTP connections that are currently active or idle on the client.

NewClientOpenConnections

func NewClientOpenConnections(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (ClientOpenConnections, error)

NewClientOpenConnections returns a new ClientOpenConnections instrument.

ClientOpenConnections.Add

func (m ClientOpenConnections) Add(
	ctx context.Context,
	incr int64,
	connectionState ConnectionStateAttr,
	serverAddress string,
	serverPort int,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

The connectionState is the state of the HTTP connection in the HTTP connection pool.

The serverAddress is the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

The serverPort is the port identifier of the "URI origin" HTTP request is sent to.

All additional attrs passed are included in the recorded value.

ClientOpenConnections.AttrNetworkPeerAddress

func (ClientOpenConnections) AttrNetworkPeerAddress(val string) attribute.KeyValue

AttrNetworkPeerAddress returns an optional attribute for the "network.peer.address" semantic convention. It represents the peer address of the network connection - IP address or Unix domain socket name.

ClientOpenConnections.AttrNetworkProtocolVersion

func (ClientOpenConnections) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ClientOpenConnections.AttrURLScheme

func (ClientOpenConnections) AttrURLScheme(val string) attribute.KeyValue

AttrURLScheme returns an optional attribute for the "url.scheme" semantic convention. It represents the URI scheme component identifying the used protocol.

ClientOpenConnections.Description

func (ClientOpenConnections) Description() string

Description returns the semantic convention description of the instrument

ClientOpenConnections.Inst

func (m ClientOpenConnections) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

ClientOpenConnections.Name

func (ClientOpenConnections) Name() string

Name returns the semantic convention name of the instrument.

ClientOpenConnections.Unit

func (ClientOpenConnections) Unit() string

Unit returns the semantic convention unit of the instrument

ClientRequestBodySize

type ClientRequestBodySize struct {
	metric.Int64Histogram
}

ClientRequestBodySize is an instrument used to record metric values conforming to the "http.client.request.body.size" semantic conventions. It represents the size of HTTP client request bodies.

NewClientRequestBodySize

func NewClientRequestBodySize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ClientRequestBodySize, error)

NewClientRequestBodySize returns a new ClientRequestBodySize instrument.

ClientRequestBodySize.AttrErrorType

func (ClientRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

ClientRequestBodySize.AttrNetworkProtocolName

func (ClientRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue

AttrNetworkProtocolName returns an optional attribute for the "network.protocol.name" semantic convention. It represents the OSI application layer or non-OSI equivalent.

ClientRequestBodySize.AttrNetworkProtocolVersion

func (ClientRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ClientRequestBodySize.AttrResponseStatusCode

func (ClientRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue

AttrResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP response status code.

ClientRequestBodySize.AttrURLScheme

func (ClientRequestBodySize) AttrURLScheme(val string) attribute.KeyValue

AttrURLScheme returns an optional attribute for the "url.scheme" semantic convention. It represents the URI scheme component identifying the used protocol.

ClientRequestBodySize.AttrURLTemplate

func (ClientRequestBodySize) AttrURLTemplate(val string) attribute.KeyValue

AttrURLTemplate returns an optional attribute for the "url.template" semantic convention. It represents the low-cardinality template of an absolute path reference.

ClientRequestBodySize.Description

func (ClientRequestBodySize) Description() string

Description returns the semantic convention description of the instrument

ClientRequestBodySize.Inst

func (m ClientRequestBodySize) Inst() metric.Int64Histogram

Inst returns the underlying metric instrument.

ClientRequestBodySize.Name

func (ClientRequestBodySize) Name() string

Name returns the semantic convention name of the instrument.

ClientRequestBodySize.Record

func (m ClientRequestBodySize) Record(
	ctx context.Context,
	val int64,
	requestMethod RequestMethodAttr,
	serverAddress string,
	serverPort int,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The requestMethod is the HTTP request method.

The serverAddress is the host identifier of the "URI origin" HTTP request is sent to.

The serverPort is the port identifier of the "URI origin" HTTP request is sent to.

All additional attrs passed are included in the recorded value.

The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.

ClientRequestBodySize.Unit

func (ClientRequestBodySize) Unit() string

Unit returns the semantic convention unit of the instrument

ClientRequestDuration

type ClientRequestDuration struct {
	metric.Float64Histogram
}

ClientRequestDuration is an instrument used to record metric values conforming to the "http.client.request.duration" semantic conventions. It represents the duration of HTTP client requests.

NewClientRequestDuration

func NewClientRequestDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ClientRequestDuration, error)

NewClientRequestDuration returns a new ClientRequestDuration instrument.

ClientRequestDuration.AttrErrorType

func (ClientRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

ClientRequestDuration.AttrNetworkProtocolName

func (ClientRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue

AttrNetworkProtocolName returns an optional attribute for the "network.protocol.name" semantic convention. It represents the OSI application layer or non-OSI equivalent.

ClientRequestDuration.AttrNetworkProtocolVersion

func (ClientRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ClientRequestDuration.AttrResponseStatusCode

func (ClientRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue

AttrResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP response status code.

ClientRequestDuration.AttrURLScheme

func (ClientRequestDuration) AttrURLScheme(val string) attribute.KeyValue

AttrURLScheme returns an optional attribute for the "url.scheme" semantic convention. It represents the URI scheme component identifying the used protocol.

ClientRequestDuration.AttrURLTemplate

func (ClientRequestDuration) AttrURLTemplate(val string) attribute.KeyValue

AttrURLTemplate returns an optional attribute for the "url.template" semantic convention. It represents the low-cardinality template of an absolute path reference.

ClientRequestDuration.Description

func (ClientRequestDuration) Description() string

Description returns the semantic convention description of the instrument

ClientRequestDuration.Inst

func (m ClientRequestDuration) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

ClientRequestDuration.Name

func (ClientRequestDuration) Name() string

Name returns the semantic convention name of the instrument.

ClientRequestDuration.Record

func (m ClientRequestDuration) Record(
	ctx context.Context,
	val float64,
	requestMethod RequestMethodAttr,
	serverAddress string,
	serverPort int,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The requestMethod is the HTTP request method.

The serverAddress is the host identifier of the "URI origin" HTTP request is sent to.

The serverPort is the port identifier of the "URI origin" HTTP request is sent to.

All additional attrs passed are included in the recorded value.

ClientRequestDuration.Unit

func (ClientRequestDuration) Unit() string

Unit returns the semantic convention unit of the instrument

ClientResponseBodySize

type ClientResponseBodySize struct {
	metric.Int64Histogram
}

ClientResponseBodySize is an instrument used to record metric values conforming to the "http.client.response.body.size" semantic conventions. It represents the size of HTTP client response bodies.

NewClientResponseBodySize

func NewClientResponseBodySize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ClientResponseBodySize, error)

NewClientResponseBodySize returns a new ClientResponseBodySize instrument.

ClientResponseBodySize.AttrErrorType

func (ClientResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

ClientResponseBodySize.AttrNetworkProtocolName

func (ClientResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue

AttrNetworkProtocolName returns an optional attribute for the "network.protocol.name" semantic convention. It represents the OSI application layer or non-OSI equivalent.

ClientResponseBodySize.AttrNetworkProtocolVersion

func (ClientResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ClientResponseBodySize.AttrResponseStatusCode

func (ClientResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue

AttrResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP response status code.

ClientResponseBodySize.AttrURLScheme

func (ClientResponseBodySize) AttrURLScheme(val string) attribute.KeyValue

AttrURLScheme returns an optional attribute for the "url.scheme" semantic convention. It represents the URI scheme component identifying the used protocol.

ClientResponseBodySize.AttrURLTemplate

func (ClientResponseBodySize) AttrURLTemplate(val string) attribute.KeyValue

AttrURLTemplate returns an optional attribute for the "url.template" semantic convention. It represents the low-cardinality template of an absolute path reference.

ClientResponseBodySize.Description

func (ClientResponseBodySize) Description() string

Description returns the semantic convention description of the instrument

ClientResponseBodySize.Inst

func (m ClientResponseBodySize) Inst() metric.Int64Histogram

Inst returns the underlying metric instrument.

ClientResponseBodySize.Name

func (ClientResponseBodySize) Name() string

Name returns the semantic convention name of the instrument.

ClientResponseBodySize.Record

func (m ClientResponseBodySize) Record(
	ctx context.Context,
	val int64,
	requestMethod RequestMethodAttr,
	serverAddress string,
	serverPort int,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The requestMethod is the HTTP request method.

The serverAddress is the host identifier of the "URI origin" HTTP request is sent to.

The serverPort is the port identifier of the "URI origin" HTTP request is sent to.

All additional attrs passed are included in the recorded value.

The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.

ClientResponseBodySize.Unit

func (ClientResponseBodySize) Unit() string

Unit returns the semantic convention unit of the instrument

ConnectionStateAttr

type ConnectionStateAttr string

ConnectionStateAttr is an attribute conforming to the http.connection.state semantic conventions. It represents the state of the HTTP connection in the HTTP connection pool.

ConnectionStateActive (2 declarations)

var (
	// ConnectionStateActive is the active state.
	ConnectionStateActive ConnectionStateAttr = "active"
	// ConnectionStateIdle is the idle state.
	ConnectionStateIdle ConnectionStateAttr = "idle"
)

ErrorTypeAttr

type ErrorTypeAttr string

ErrorTypeAttr is an attribute conforming to the error.type semantic conventions. It represents the describes a class of error the operation ended with.

ErrorTypeOther

var ErrorTypeOther ErrorTypeAttr = "_OTHER"

ErrorTypeOther is a fallback error value to be used when the instrumentation doesn't define a custom value.

RequestMethodAttr

type RequestMethodAttr string

RequestMethodAttr is an attribute conforming to the http.request.method semantic conventions. It represents the HTTP request method.

RequestMethodConnect (10 declarations)

var (
	// RequestMethodConnect is the CONNECT method.
	RequestMethodConnect RequestMethodAttr = "CONNECT"
	// RequestMethodDelete is the DELETE method.
	RequestMethodDelete RequestMethodAttr = "DELETE"
	// RequestMethodGet is the GET method.
	RequestMethodGet RequestMethodAttr = "GET"
	// RequestMethodHead is the HEAD method.
	RequestMethodHead RequestMethodAttr = "HEAD"
	// RequestMethodOptions is the OPTIONS method.
	RequestMethodOptions RequestMethodAttr = "OPTIONS"
	// RequestMethodPatch is the PATCH method.
	RequestMethodPatch RequestMethodAttr = "PATCH"
	// RequestMethodPost is the POST method.
	RequestMethodPost RequestMethodAttr = "POST"
	// RequestMethodPut is the PUT method.
	RequestMethodPut RequestMethodAttr = "PUT"
	// RequestMethodTrace is the TRACE method.
	RequestMethodTrace RequestMethodAttr = "TRACE"
	// RequestMethodOther is the any HTTP method that the instrumentation has no
	// prior knowledge of.
	RequestMethodOther RequestMethodAttr = "_OTHER"
)

ServerActiveRequests

type ServerActiveRequests struct {
	metric.Int64UpDownCounter
}

ServerActiveRequests is an instrument used to record metric values conforming to the "http.server.active_requests" semantic conventions. It represents the number of active HTTP server requests.

NewServerActiveRequests

func NewServerActiveRequests(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (ServerActiveRequests, error)

NewServerActiveRequests returns a new ServerActiveRequests instrument.

ServerActiveRequests.Add

func (m ServerActiveRequests) Add(
	ctx context.Context,
	incr int64,
	requestMethod RequestMethodAttr,
	urlScheme string,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

The requestMethod is the HTTP request method.

The urlScheme is the the URI scheme component identifying the used protocol.

All additional attrs passed are included in the recorded value.

ServerActiveRequests.AttrServerAddress

func (ServerActiveRequests) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the name of the local HTTP server that received the request.

ServerActiveRequests.AttrServerPort

func (ServerActiveRequests) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the port of the local HTTP server that received the request.

ServerActiveRequests.Description

func (ServerActiveRequests) Description() string

Description returns the semantic convention description of the instrument

ServerActiveRequests.Inst

func (m ServerActiveRequests) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

ServerActiveRequests.Name

func (ServerActiveRequests) Name() string

Name returns the semantic convention name of the instrument.

ServerActiveRequests.Unit

func (ServerActiveRequests) Unit() string

Unit returns the semantic convention unit of the instrument

ServerRequestBodySize

type ServerRequestBodySize struct {
	metric.Int64Histogram
}

ServerRequestBodySize is an instrument used to record metric values conforming to the "http.server.request.body.size" semantic conventions. It represents the size of HTTP server request bodies.

NewServerRequestBodySize

func NewServerRequestBodySize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ServerRequestBodySize, error)

NewServerRequestBodySize returns a new ServerRequestBodySize instrument.

ServerRequestBodySize.AttrErrorType

func (ServerRequestBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

ServerRequestBodySize.AttrNetworkProtocolName

func (ServerRequestBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue

AttrNetworkProtocolName returns an optional attribute for the "network.protocol.name" semantic convention. It represents the OSI application layer or non-OSI equivalent.

ServerRequestBodySize.AttrNetworkProtocolVersion

func (ServerRequestBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ServerRequestBodySize.AttrResponseStatusCode

func (ServerRequestBodySize) AttrResponseStatusCode(val int) attribute.KeyValue

AttrResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP response status code.

ServerRequestBodySize.AttrRoute

func (ServerRequestBodySize) AttrRoute(val string) attribute.KeyValue

AttrRoute returns an optional attribute for the "http.route" semantic convention. It represents the matched route, that is, the path template in the format used by the respective server framework.

ServerRequestBodySize.AttrServerAddress

func (ServerRequestBodySize) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the name of the local HTTP server that received the request.

ServerRequestBodySize.AttrServerPort

func (ServerRequestBodySize) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the port of the local HTTP server that received the request.

ServerRequestBodySize.AttrUserAgentSyntheticType

func (ServerRequestBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue

AttrUserAgentSyntheticType returns an optional attribute for the "user_agent.synthetic.type" semantic convention. It represents the specifies the category of synthetic traffic, such as tests or bots.

ServerRequestBodySize.Description

func (ServerRequestBodySize) Description() string

Description returns the semantic convention description of the instrument

ServerRequestBodySize.Inst

func (m ServerRequestBodySize) Inst() metric.Int64Histogram

Inst returns the underlying metric instrument.

ServerRequestBodySize.Name

func (ServerRequestBodySize) Name() string

Name returns the semantic convention name of the instrument.

ServerRequestBodySize.Record

func (m ServerRequestBodySize) Record(
	ctx context.Context,
	val int64,
	requestMethod RequestMethodAttr,
	urlScheme string,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The requestMethod is the HTTP request method.

The urlScheme is the the URI scheme component identifying the used protocol.

All additional attrs passed are included in the recorded value.

The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.

ServerRequestBodySize.Unit

func (ServerRequestBodySize) Unit() string

Unit returns the semantic convention unit of the instrument

ServerRequestDuration

type ServerRequestDuration struct {
	metric.Float64Histogram
}

ServerRequestDuration is an instrument used to record metric values conforming to the "http.server.request.duration" semantic conventions. It represents the duration of HTTP server requests.

NewServerRequestDuration

func NewServerRequestDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ServerRequestDuration, error)

NewServerRequestDuration returns a new ServerRequestDuration instrument.

ServerRequestDuration.AttrErrorType

func (ServerRequestDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

ServerRequestDuration.AttrNetworkProtocolName

func (ServerRequestDuration) AttrNetworkProtocolName(val string) attribute.KeyValue

AttrNetworkProtocolName returns an optional attribute for the "network.protocol.name" semantic convention. It represents the OSI application layer or non-OSI equivalent.

ServerRequestDuration.AttrNetworkProtocolVersion

func (ServerRequestDuration) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ServerRequestDuration.AttrResponseStatusCode

func (ServerRequestDuration) AttrResponseStatusCode(val int) attribute.KeyValue

AttrResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP response status code.

ServerRequestDuration.AttrRoute

func (ServerRequestDuration) AttrRoute(val string) attribute.KeyValue

AttrRoute returns an optional attribute for the "http.route" semantic convention. It represents the matched route, that is, the path template in the format used by the respective server framework.

ServerRequestDuration.AttrServerAddress

func (ServerRequestDuration) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the name of the local HTTP server that received the request.

ServerRequestDuration.AttrServerPort

func (ServerRequestDuration) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the port of the local HTTP server that received the request.

ServerRequestDuration.AttrUserAgentSyntheticType

func (ServerRequestDuration) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue

AttrUserAgentSyntheticType returns an optional attribute for the "user_agent.synthetic.type" semantic convention. It represents the specifies the category of synthetic traffic, such as tests or bots.

ServerRequestDuration.Description

func (ServerRequestDuration) Description() string

Description returns the semantic convention description of the instrument

ServerRequestDuration.Inst

func (m ServerRequestDuration) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

ServerRequestDuration.Name

func (ServerRequestDuration) Name() string

Name returns the semantic convention name of the instrument.

ServerRequestDuration.Record

func (m ServerRequestDuration) Record(
	ctx context.Context,
	val float64,
	requestMethod RequestMethodAttr,
	urlScheme string,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The requestMethod is the HTTP request method.

The urlScheme is the the URI scheme component identifying the used protocol.

All additional attrs passed are included in the recorded value.

ServerRequestDuration.Unit

func (ServerRequestDuration) Unit() string

Unit returns the semantic convention unit of the instrument

ServerResponseBodySize

type ServerResponseBodySize struct {
	metric.Int64Histogram
}

ServerResponseBodySize is an instrument used to record metric values conforming to the "http.server.response.body.size" semantic conventions. It represents the size of HTTP server response bodies.

NewServerResponseBodySize

func NewServerResponseBodySize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ServerResponseBodySize, error)

NewServerResponseBodySize returns a new ServerResponseBodySize instrument.

ServerResponseBodySize.AttrErrorType

func (ServerResponseBodySize) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

ServerResponseBodySize.AttrNetworkProtocolName

func (ServerResponseBodySize) AttrNetworkProtocolName(val string) attribute.KeyValue

AttrNetworkProtocolName returns an optional attribute for the "network.protocol.name" semantic convention. It represents the OSI application layer or non-OSI equivalent.

ServerResponseBodySize.AttrNetworkProtocolVersion

func (ServerResponseBodySize) AttrNetworkProtocolVersion(val string) attribute.KeyValue

AttrNetworkProtocolVersion returns an optional attribute for the "network.protocol.version" semantic convention. It represents the actual version of the protocol used for network communication.

ServerResponseBodySize.AttrResponseStatusCode

func (ServerResponseBodySize) AttrResponseStatusCode(val int) attribute.KeyValue

AttrResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP response status code.

ServerResponseBodySize.AttrRoute

func (ServerResponseBodySize) AttrRoute(val string) attribute.KeyValue

AttrRoute returns an optional attribute for the "http.route" semantic convention. It represents the matched route, that is, the path template in the format used by the respective server framework.

ServerResponseBodySize.AttrServerAddress

func (ServerResponseBodySize) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the name of the local HTTP server that received the request.

ServerResponseBodySize.AttrServerPort

func (ServerResponseBodySize) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the port of the local HTTP server that received the request.

ServerResponseBodySize.AttrUserAgentSyntheticType

func (ServerResponseBodySize) AttrUserAgentSyntheticType(val UserAgentSyntheticTypeAttr) attribute.KeyValue

AttrUserAgentSyntheticType returns an optional attribute for the "user_agent.synthetic.type" semantic convention. It represents the specifies the category of synthetic traffic, such as tests or bots.

ServerResponseBodySize.Description

func (ServerResponseBodySize) Description() string

Description returns the semantic convention description of the instrument

ServerResponseBodySize.Inst

func (m ServerResponseBodySize) Inst() metric.Int64Histogram

Inst returns the underlying metric instrument.

ServerResponseBodySize.Name

func (ServerResponseBodySize) Name() string

Name returns the semantic convention name of the instrument.

ServerResponseBodySize.Record

func (m ServerResponseBodySize) Record(
	ctx context.Context,
	val int64,
	requestMethod RequestMethodAttr,
	urlScheme string,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

The requestMethod is the HTTP request method.

The urlScheme is the the URI scheme component identifying the used protocol.

All additional attrs passed are included in the recorded value.

The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the Content-Length header. For requests using transport encoding, this should be the compressed size.

ServerResponseBodySize.Unit

func (ServerResponseBodySize) Unit() string

Unit returns the semantic convention unit of the instrument

UserAgentSyntheticTypeAttr

type UserAgentSyntheticTypeAttr string

UserAgentSyntheticTypeAttr is an attribute conforming to the user_agent.synthetic.type semantic conventions. It represents the specifies the category of synthetic traffic, such as tests or bots.

UserAgentSyntheticTypeBot (2 declarations)

var (
	// UserAgentSyntheticTypeBot is the bot source.
	UserAgentSyntheticTypeBot UserAgentSyntheticTypeAttr = "bot"
	// UserAgentSyntheticTypeTest is the synthetic test source.
	UserAgentSyntheticTypeTest UserAgentSyntheticTypeAttr = "test"
)

Dependency graph