http

package
v0.0.0-...-4ef6f69 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instrument

func Instrument(m Metrics, h http.Handler) http.Handler
Example
mux := http.NewServeMux()
mux.HandleFunc("/hello/{name}", func(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Hello %s!", r.PathValue("name"))
})
mux.Handle("/metrics", promhttp.Handler())

handler := Instrument(Register(prometheus.DefaultRegisterer), mux)
done := make(chan struct{})
go func() {
	l, err := net.Listen("tcp", ":4242")
	if err != nil {
		log.Fatalln(err)
	}
	close(done)
	log.Fatalln(http.Serve(l, handler))
}()
<-done

if _, err := http.Get("http://localhost:4242/hello/prometheus"); err != nil {
	log.Fatalln(err)
}

res, err := http.Get("http://localhost:4242/metrics")
if err != nil {
	log.Fatalln(err)
}

sc := bufio.NewScanner(res.Body)
for sc.Scan() {
	if strings.HasPrefix(sc.Text(), "http_server_request_duration_sum") {
		if x, _, ok := strings.Cut(sc.Text(), "} "); ok {
			fmt.Printf("%s} <unstable>\n", x)
			continue
		}
	}
	if strings.HasPrefix(sc.Text(), "http_") {
		fmt.Println(sc.Text())
	}
}
Output:
http_server_active_requests{http_request_method="GET",server_address="127.0.0.1",server_port="4242",url_scheme=""} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.005"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.01"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.025"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.05"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.1"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.25"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.5"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="1"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="2.5"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="5"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="10"} 1
http_server_request_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="+Inf"} 1
http_server_request_body_size_sum{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type=""} 0
http_server_request_body_size_count{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type=""} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.005"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.01"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.025"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.05"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.1"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.25"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.5"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="1"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="2.5"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="5"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="10"} 1
http_server_request_duration_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="+Inf"} 1
http_server_request_duration_sum{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type=""} <unstable>
http_server_request_duration_count{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type=""} 1
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.005"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.01"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.025"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.05"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.1"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.25"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="0.5"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="1"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="2.5"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="5"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="10"} 0
http_server_response_body_size_bucket{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type="",le="+Inf"} 1
http_server_response_body_size_sum{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type=""} 17
http_server_response_body_size_count{error_type="",http_request_method="GET",http_response_status_code="200",http_route="/hello/{name}",network_protocol_name="http",network_protocol_version="1.1",server_address="127.0.0.1",server_port="4242",url_scheme="",user_agent_synthetic_type=""} 1

func Scheme

func Scheme(r *http.Request) url.AttrScheme

Types

type AttrClientIp

type AttrClientIp string // http.client_ip

Deprecated, use `client.address` instead

func (AttrClientIp) Development

func (AttrClientIp) Development()

func (AttrClientIp) Key

func (AttrClientIp) Key() string

func (AttrClientIp) Recommended

func (AttrClientIp) Recommended()

func (AttrClientIp) Value

func (a AttrClientIp) Value() string

type AttrConnectionState

type AttrConnectionState string // http.connection.state

State of the HTTP connection in the HTTP connection pool

const ConnectionStateActive AttrConnectionState = "active"
const ConnectionStateIdle AttrConnectionState = "idle"

func (AttrConnectionState) Development

func (AttrConnectionState) Development()

func (AttrConnectionState) Key

func (AttrConnectionState) Recommended

func (AttrConnectionState) Recommended()

func (AttrConnectionState) Value

func (a AttrConnectionState) Value() string

type AttrFlavor

type AttrFlavor string // http.flavor

Deprecated, use `network.protocol.name` instead

const FlavorHttp10 AttrFlavor = "1.0"
const FlavorHttp11 AttrFlavor = "1.1"
const FlavorHttp20 AttrFlavor = "2.0"
const FlavorHttp30 AttrFlavor = "3.0"
const FlavorQuic AttrFlavor = "QUIC"
const FlavorSpdy AttrFlavor = "SPDY"

func (AttrFlavor) Development

func (AttrFlavor) Development()

func (AttrFlavor) Key

func (AttrFlavor) Key() string

func (AttrFlavor) Recommended

func (AttrFlavor) Recommended()

func (AttrFlavor) Value

func (a AttrFlavor) Value() string

type AttrHost

type AttrHost string // http.host

Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage

func (AttrHost) Development

func (AttrHost) Development()

func (AttrHost) Key

func (AttrHost) Key() string

func (AttrHost) Recommended

func (AttrHost) Recommended()

func (AttrHost) Value

func (a AttrHost) Value() string

type AttrMethod

type AttrMethod string // http.method

Deprecated, use `http.request.method` instead

func (AttrMethod) Development

func (AttrMethod) Development()

func (AttrMethod) Key

func (AttrMethod) Key() string

func (AttrMethod) Recommended

func (AttrMethod) Recommended()

func (AttrMethod) Value

func (a AttrMethod) Value() string

type AttrRequestBodySize

type AttrRequestBodySize string // http.request.body.size

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

func (AttrRequestBodySize) Development

func (AttrRequestBodySize) Development()

func (AttrRequestBodySize) Key

func (AttrRequestBodySize) Recommended

func (AttrRequestBodySize) Recommended()

func (AttrRequestBodySize) Value

func (a AttrRequestBodySize) Value() string

type AttrRequestContentLength

type AttrRequestContentLength string // http.request_content_length

Deprecated, use `http.request.header.content-length` instead

func (AttrRequestContentLength) Development

func (AttrRequestContentLength) Development()

func (AttrRequestContentLength) Key

func (AttrRequestContentLength) Recommended

func (AttrRequestContentLength) Recommended()

func (AttrRequestContentLength) Value

func (a AttrRequestContentLength) Value() string

type AttrRequestContentLengthUncompressed

type AttrRequestContentLengthUncompressed string // http.request_content_length_uncompressed

Deprecated, use `http.request.body.size` instead

func (AttrRequestContentLengthUncompressed) Development

func (AttrRequestContentLengthUncompressed) Key

func (AttrRequestContentLengthUncompressed) Recommended

func (AttrRequestContentLengthUncompressed) Value

type AttrRequestHeader

type AttrRequestHeader string // http.request.header

HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.

Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.

The `User-Agent` header is already captured in the `user_agent.original` attribute. Users MAY explicitly configure instrumentations to capture them even though it is not recommended.

The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.

Examples:

  • A header `Content-Type: application/json` SHOULD be recorded as the `http.request.header.content-type` attribute with value `["application/json"]`.
  • A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` SHOULD be recorded as the `http.request.header.x-forwarded-for` attribute with value `["1.2.3.4", "1.2.3.5"]` or `["1.2.3.4, 1.2.3.5"]` depending on the HTTP library

func (AttrRequestHeader) Key

func (AttrRequestHeader) Key() string

func (AttrRequestHeader) Recommended

func (AttrRequestHeader) Recommended()

func (AttrRequestHeader) Stable

func (AttrRequestHeader) Stable()

func (AttrRequestHeader) Value

func (a AttrRequestHeader) Value() string

type AttrRequestMethod

type AttrRequestMethod string // http.request.method

HTTP request method. HTTP request method value SHOULD be "known" to the instrumentation. By default, this convention defines "known" methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789.

If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`.

If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults).

HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value

const RequestMethodConnect AttrRequestMethod = "CONNECT"
const RequestMethodDelete AttrRequestMethod = "DELETE"
const RequestMethodGet AttrRequestMethod = "GET"
const RequestMethodHead AttrRequestMethod = "HEAD"
const RequestMethodOptions AttrRequestMethod = "OPTIONS"
const RequestMethodOther AttrRequestMethod = "_OTHER"
const RequestMethodPatch AttrRequestMethod = "PATCH"
const RequestMethodPost AttrRequestMethod = "POST"
const RequestMethodPut AttrRequestMethod = "PUT"
const RequestMethodTrace AttrRequestMethod = "TRACE"

func Method

func Method(r *http.Request) AttrRequestMethod

func (AttrRequestMethod) Key

func (AttrRequestMethod) Key() string

func (AttrRequestMethod) Recommended

func (AttrRequestMethod) Recommended()

func (AttrRequestMethod) Stable

func (AttrRequestMethod) Stable()

func (AttrRequestMethod) Value

func (a AttrRequestMethod) Value() string

type AttrRequestMethodOriginal

type AttrRequestMethodOriginal string // http.request.method_original

Original HTTP method sent by the client in the request line

func (AttrRequestMethodOriginal) Key

func (AttrRequestMethodOriginal) Recommended

func (AttrRequestMethodOriginal) Recommended()

func (AttrRequestMethodOriginal) Stable

func (AttrRequestMethodOriginal) Stable()

func (AttrRequestMethodOriginal) Value

type AttrRequestResendCount

type AttrRequestResendCount string // http.request.resend_count

The ordinal number of request resending attempt (for any reason, including redirects).

The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other)

func (AttrRequestResendCount) Key

func (AttrRequestResendCount) Recommended

func (AttrRequestResendCount) Recommended()

func (AttrRequestResendCount) Stable

func (AttrRequestResendCount) Stable()

func (AttrRequestResendCount) Value

func (a AttrRequestResendCount) Value() string

type AttrRequestSize

type AttrRequestSize string // http.request.size

The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any

func (AttrRequestSize) Development

func (AttrRequestSize) Development()

func (AttrRequestSize) Key

func (AttrRequestSize) Key() string

func (AttrRequestSize) Recommended

func (AttrRequestSize) Recommended()

func (AttrRequestSize) Value

func (a AttrRequestSize) Value() string

type AttrResponseBodySize

type AttrResponseBodySize string // http.response.body.size

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

func (AttrResponseBodySize) Development

func (AttrResponseBodySize) Development()

func (AttrResponseBodySize) Key

func (AttrResponseBodySize) Recommended

func (AttrResponseBodySize) Recommended()

func (AttrResponseBodySize) Value

func (a AttrResponseBodySize) Value() string

type AttrResponseContentLength

type AttrResponseContentLength string // http.response_content_length

Deprecated, use `http.response.header.content-length` instead

func (AttrResponseContentLength) Development

func (AttrResponseContentLength) Development()

func (AttrResponseContentLength) Key

func (AttrResponseContentLength) Recommended

func (AttrResponseContentLength) Recommended()

func (AttrResponseContentLength) Value

type AttrResponseContentLengthUncompressed

type AttrResponseContentLengthUncompressed string // http.response_content_length_uncompressed

Deprecated, use `http.response.body.size` instead

func (AttrResponseContentLengthUncompressed) Development

func (AttrResponseContentLengthUncompressed) Key

func (AttrResponseContentLengthUncompressed) Recommended

func (AttrResponseContentLengthUncompressed) Value

type AttrResponseHeader

type AttrResponseHeader string // http.response.header

HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.

Instrumentations SHOULD require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.

Users MAY explicitly configure instrumentations to capture them even though it is not recommended.

The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.

Examples:

  • A header `Content-Type: application/json` header SHOULD be recorded as the `http.request.response.content-type` attribute with value `["application/json"]`.
  • A header `My-custom-header: abc, def` header SHOULD be recorded as the `http.response.header.my-custom-header` attribute with value `["abc", "def"]` or `["abc, def"]` depending on the HTTP library

func (AttrResponseHeader) Key

func (AttrResponseHeader) Key() string

func (AttrResponseHeader) Recommended

func (AttrResponseHeader) Recommended()

func (AttrResponseHeader) Stable

func (AttrResponseHeader) Stable()

func (AttrResponseHeader) Value

func (a AttrResponseHeader) Value() string

type AttrResponseSize

type AttrResponseSize string // http.response.size

The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any

func (AttrResponseSize) Development

func (AttrResponseSize) Development()

func (AttrResponseSize) Key

func (AttrResponseSize) Key() string

func (AttrResponseSize) Recommended

func (AttrResponseSize) Recommended()

func (AttrResponseSize) Value

func (a AttrResponseSize) Value() string

type AttrResponseStatusCode

type AttrResponseStatusCode string // http.response.status_code

HTTP response status code

func (AttrResponseStatusCode) Key

func (AttrResponseStatusCode) Recommended

func (AttrResponseStatusCode) Recommended()

func (AttrResponseStatusCode) Stable

func (AttrResponseStatusCode) Stable()

func (AttrResponseStatusCode) Value

func (a AttrResponseStatusCode) Value() string

type AttrRoute

type AttrRoute string // http.route

The matched route, that is, the path template in the format used by the respective server framework.

MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the [application root] if there is one

[application root]: /docs/http/http-spans.md#http-server-definitions

func (AttrRoute) Key

func (AttrRoute) Key() string

func (AttrRoute) Recommended

func (AttrRoute) Recommended()

func (AttrRoute) Stable

func (AttrRoute) Stable()

func (AttrRoute) Value

func (a AttrRoute) Value() string

type AttrScheme

type AttrScheme string // http.scheme

Deprecated, use `url.scheme` instead

func (AttrScheme) Development

func (AttrScheme) Development()

func (AttrScheme) Key

func (AttrScheme) Key() string

func (AttrScheme) Recommended

func (AttrScheme) Recommended()

func (AttrScheme) Value

func (a AttrScheme) Value() string

type AttrServerName

type AttrServerName string // http.server_name

Deprecated, use `server.address` instead

func (AttrServerName) Development

func (AttrServerName) Development()

func (AttrServerName) Key

func (AttrServerName) Key() string

func (AttrServerName) Recommended

func (AttrServerName) Recommended()

func (AttrServerName) Value

func (a AttrServerName) Value() string

type AttrStatusCode

type AttrStatusCode string // http.status_code

Deprecated, use `http.response.status_code` instead

func (AttrStatusCode) Development

func (AttrStatusCode) Development()

func (AttrStatusCode) Key

func (AttrStatusCode) Key() string

func (AttrStatusCode) Recommended

func (AttrStatusCode) Recommended()

func (AttrStatusCode) Value

func (a AttrStatusCode) Value() string

type AttrTarget

type AttrTarget string // http.target

Deprecated, use `url.path` and `url.query` instead

func (AttrTarget) Development

func (AttrTarget) Development()

func (AttrTarget) Key

func (AttrTarget) Key() string

func (AttrTarget) Recommended

func (AttrTarget) Recommended()

func (AttrTarget) Value

func (a AttrTarget) Value() string

type AttrUrl

type AttrUrl string // http.url

Deprecated, use `url.full` instead

func (AttrUrl) Development

func (AttrUrl) Development()

func (AttrUrl) Key

func (AttrUrl) Key() string

func (AttrUrl) Recommended

func (AttrUrl) Recommended()

func (AttrUrl) Value

func (a AttrUrl) Value() string

type AttrUserAgent

type AttrUserAgent string // http.user_agent

Deprecated, use `user_agent.original` instead

func (AttrUserAgent) Development

func (AttrUserAgent) Development()

func (AttrUserAgent) Key

func (AttrUserAgent) Key() string

func (AttrUserAgent) Recommended

func (AttrUserAgent) Recommended()

func (AttrUserAgent) Value

func (a AttrUserAgent) Value() string

type Attributes

type Attributes struct {
	// contains filtered or unexported fields
}

TODO: generate from yaml

type ClientActiveRequests

type ClientActiveRequests struct {
	*prometheus.GaugeVec
	// contains filtered or unexported fields
}

Number of active HTTP requests.

func NewClientActiveRequests

func NewClientActiveRequests() ClientActiveRequests

func (ClientActiveRequests) With

func (m ClientActiveRequests) With(address server.AttrAddress, port server.AttrPort, extras ...interface {
	UrlTemplate() url.AttrTemplate
	HttpRequestMethod() AttrRequestMethod
	UrlScheme() url.AttrScheme
}) prometheus.Gauge

func (ClientActiveRequests) WithLabelValues deprecated

func (m ClientActiveRequests) WithLabelValues(lvs ...string) prometheus.Gauge

Deprecated: Use ClientActiveRequests.With instead

func (ClientActiveRequests) WithRequestMethod

func (a ClientActiveRequests) WithRequestMethod(attr interface{ HttpRequestMethod() AttrRequestMethod }) ClientActiveRequests

func (ClientActiveRequests) WithUrlScheme

func (a ClientActiveRequests) WithUrlScheme(attr interface{ UrlScheme() url.AttrScheme }) ClientActiveRequests

func (ClientActiveRequests) WithUrlTemplate

func (a ClientActiveRequests) WithUrlTemplate(attr interface{ UrlTemplate() url.AttrTemplate }) ClientActiveRequests

type ClientActiveRequestsExtra

type ClientActiveRequestsExtra struct {
	// The low-cardinality template of an [absolute path reference]
	//
	// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
	AttrUrlTemplate   url.AttrTemplate  `otel:"url.template"`        // HTTP request method
	AttrRequestMethod AttrRequestMethod `otel:"http.request.method"` // The [URI scheme] component identifying the used protocol
	//
	// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	AttrUrlScheme url.AttrScheme `otel:"url.scheme"`
}

func (ClientActiveRequestsExtra) HttpRequestMethod

func (a ClientActiveRequestsExtra) HttpRequestMethod() AttrRequestMethod

func (ClientActiveRequestsExtra) UrlScheme

func (ClientActiveRequestsExtra) UrlTemplate

func (a ClientActiveRequestsExtra) UrlTemplate() url.AttrTemplate

type ClientConnectionDuration

type ClientConnectionDuration struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

The duration of the successfully established outbound HTTP connections.

func NewClientConnectionDuration

func NewClientConnectionDuration() ClientConnectionDuration

func (ClientConnectionDuration) With

func (m ClientConnectionDuration) With(address server.AttrAddress, port server.AttrPort, extras ...interface {
	NetworkPeerAddress() network.AttrPeerAddress
	NetworkProtocolVersion() network.AttrProtocolVersion
	UrlScheme() url.AttrScheme
}) prometheus.Observer

func (ClientConnectionDuration) WithLabelValues deprecated

func (m ClientConnectionDuration) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ClientConnectionDuration.With instead

func (ClientConnectionDuration) WithNetworkPeerAddress

func (a ClientConnectionDuration) WithNetworkPeerAddress(attr interface {
	NetworkPeerAddress() network.AttrPeerAddress
}) ClientConnectionDuration

func (ClientConnectionDuration) WithNetworkProtocolVersion

func (a ClientConnectionDuration) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ClientConnectionDuration

func (ClientConnectionDuration) WithUrlScheme

func (a ClientConnectionDuration) WithUrlScheme(attr interface{ UrlScheme() url.AttrScheme }) ClientConnectionDuration

type ClientConnectionDurationExtra

type ClientConnectionDurationExtra struct {
	// Peer address of the network connection - IP address or Unix domain socket name
	AttrNetworkPeerAddress     network.AttrPeerAddress     `otel:"network.peer.address"`     // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion `otel:"network.protocol.version"` // The [URI scheme] component identifying the used protocol
	//
	// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	AttrUrlScheme url.AttrScheme `otel:"url.scheme"`
}

func (ClientConnectionDurationExtra) NetworkPeerAddress

func (a ClientConnectionDurationExtra) NetworkPeerAddress() network.AttrPeerAddress

func (ClientConnectionDurationExtra) NetworkProtocolVersion

func (a ClientConnectionDurationExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ClientConnectionDurationExtra) UrlScheme

type ClientOpenConnections

type ClientOpenConnections struct {
	*prometheus.GaugeVec
	// contains filtered or unexported fields
}

Number of outbound HTTP connections that are currently active or idle on the client.

func NewClientOpenConnections

func NewClientOpenConnections() ClientOpenConnections

func (ClientOpenConnections) With

func (m ClientOpenConnections) With(connectionState AttrConnectionState, address server.AttrAddress, port server.AttrPort, extras ...interface {
	NetworkPeerAddress() network.AttrPeerAddress
	NetworkProtocolVersion() network.AttrProtocolVersion
	UrlScheme() url.AttrScheme
}) prometheus.Gauge

func (ClientOpenConnections) WithLabelValues deprecated

func (m ClientOpenConnections) WithLabelValues(lvs ...string) prometheus.Gauge

Deprecated: Use ClientOpenConnections.With instead

func (ClientOpenConnections) WithNetworkPeerAddress

func (a ClientOpenConnections) WithNetworkPeerAddress(attr interface {
	NetworkPeerAddress() network.AttrPeerAddress
}) ClientOpenConnections

func (ClientOpenConnections) WithNetworkProtocolVersion

func (a ClientOpenConnections) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ClientOpenConnections

func (ClientOpenConnections) WithUrlScheme

func (a ClientOpenConnections) WithUrlScheme(attr interface{ UrlScheme() url.AttrScheme }) ClientOpenConnections

type ClientOpenConnectionsExtra

type ClientOpenConnectionsExtra struct {
	// Peer address of the network connection - IP address or Unix domain socket name
	AttrNetworkPeerAddress     network.AttrPeerAddress     `otel:"network.peer.address"`     // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion `otel:"network.protocol.version"` // The [URI scheme] component identifying the used protocol
	//
	// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	AttrUrlScheme url.AttrScheme `otel:"url.scheme"`
}

func (ClientOpenConnectionsExtra) NetworkPeerAddress

func (a ClientOpenConnectionsExtra) NetworkPeerAddress() network.AttrPeerAddress

func (ClientOpenConnectionsExtra) NetworkProtocolVersion

func (a ClientOpenConnectionsExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ClientOpenConnectionsExtra) UrlScheme

type ClientRequestBodySize

type ClientRequestBodySize struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

Size of HTTP client request bodies.

func NewClientRequestBodySize

func NewClientRequestBodySize() ClientRequestBodySize

func (ClientRequestBodySize) With

func (m ClientRequestBodySize) With(requestMethod AttrRequestMethod, address server.AttrAddress, port server.AttrPort, extras ...interface {
	ErrorType() error.AttrType
	HttpResponseStatusCode() AttrResponseStatusCode
	NetworkProtocolName() network.AttrProtocolName
	UrlTemplate() url.AttrTemplate
	NetworkProtocolVersion() network.AttrProtocolVersion
	UrlScheme() url.AttrScheme
}) prometheus.Observer

func (ClientRequestBodySize) WithErrorType

func (a ClientRequestBodySize) WithErrorType(attr interface{ ErrorType() error.AttrType }) ClientRequestBodySize

func (ClientRequestBodySize) WithLabelValues deprecated

func (m ClientRequestBodySize) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ClientRequestBodySize.With instead

func (ClientRequestBodySize) WithNetworkProtocolName

func (a ClientRequestBodySize) WithNetworkProtocolName(attr interface {
	NetworkProtocolName() network.AttrProtocolName
}) ClientRequestBodySize

func (ClientRequestBodySize) WithNetworkProtocolVersion

func (a ClientRequestBodySize) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ClientRequestBodySize

func (ClientRequestBodySize) WithResponseStatusCode

func (a ClientRequestBodySize) WithResponseStatusCode(attr interface{ HttpResponseStatusCode() AttrResponseStatusCode }) ClientRequestBodySize

func (ClientRequestBodySize) WithUrlScheme

func (a ClientRequestBodySize) WithUrlScheme(attr interface{ UrlScheme() url.AttrScheme }) ClientRequestBodySize

func (ClientRequestBodySize) WithUrlTemplate

func (a ClientRequestBodySize) WithUrlTemplate(attr interface{ UrlTemplate() url.AttrTemplate }) ClientRequestBodySize

type ClientRequestBodySizeExtra

type ClientRequestBodySizeExtra struct {
	// Describes a class of error the operation ended with
	AttrErrorType error.AttrType `otel:"error.type"` // [HTTP response status code]
	//
	// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
	AttrResponseStatusCode AttrResponseStatusCode `otel:"http.response.status_code"` // [OSI application layer] or non-OSI equivalent
	//
	// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
	AttrNetworkProtocolName network.AttrProtocolName `otel:"network.protocol.name"` // The low-cardinality template of an [absolute path reference]
	//
	// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
	AttrUrlTemplate            url.AttrTemplate            `otel:"url.template"`             // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion `otel:"network.protocol.version"` // The [URI scheme] component identifying the used protocol
	//
	// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	AttrUrlScheme url.AttrScheme `otel:"url.scheme"`
}

func (ClientRequestBodySizeExtra) ErrorType

func (ClientRequestBodySizeExtra) HttpResponseStatusCode

func (a ClientRequestBodySizeExtra) HttpResponseStatusCode() AttrResponseStatusCode

func (ClientRequestBodySizeExtra) NetworkProtocolName

func (a ClientRequestBodySizeExtra) NetworkProtocolName() network.AttrProtocolName

func (ClientRequestBodySizeExtra) NetworkProtocolVersion

func (a ClientRequestBodySizeExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ClientRequestBodySizeExtra) UrlScheme

func (ClientRequestBodySizeExtra) UrlTemplate

type ClientRequestDuration

type ClientRequestDuration struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

Duration of HTTP client requests.

func NewClientRequestDuration

func NewClientRequestDuration() ClientRequestDuration

func (ClientRequestDuration) With

func (m ClientRequestDuration) With(requestMethod AttrRequestMethod, address server.AttrAddress, port server.AttrPort, extras ...interface {
	ErrorType() error.AttrType
	HttpResponseStatusCode() AttrResponseStatusCode
	NetworkProtocolName() network.AttrProtocolName
	NetworkProtocolVersion() network.AttrProtocolVersion
	UrlScheme() url.AttrScheme
	UrlTemplate() url.AttrTemplate
}) prometheus.Observer

func (ClientRequestDuration) WithErrorType

func (a ClientRequestDuration) WithErrorType(attr interface{ ErrorType() error.AttrType }) ClientRequestDuration

func (ClientRequestDuration) WithLabelValues deprecated

func (m ClientRequestDuration) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ClientRequestDuration.With instead

func (ClientRequestDuration) WithNetworkProtocolName

func (a ClientRequestDuration) WithNetworkProtocolName(attr interface {
	NetworkProtocolName() network.AttrProtocolName
}) ClientRequestDuration

func (ClientRequestDuration) WithNetworkProtocolVersion

func (a ClientRequestDuration) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ClientRequestDuration

func (ClientRequestDuration) WithResponseStatusCode

func (a ClientRequestDuration) WithResponseStatusCode(attr interface{ HttpResponseStatusCode() AttrResponseStatusCode }) ClientRequestDuration

func (ClientRequestDuration) WithUrlScheme

func (a ClientRequestDuration) WithUrlScheme(attr interface{ UrlScheme() url.AttrScheme }) ClientRequestDuration

func (ClientRequestDuration) WithUrlTemplate

func (a ClientRequestDuration) WithUrlTemplate(attr interface{ UrlTemplate() url.AttrTemplate }) ClientRequestDuration

type ClientRequestDurationExtra

type ClientRequestDurationExtra struct {
	// Describes a class of error the operation ended with
	AttrErrorType error.AttrType `otel:"error.type"` // [HTTP response status code]
	//
	// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
	AttrResponseStatusCode AttrResponseStatusCode `otel:"http.response.status_code"` // [OSI application layer] or non-OSI equivalent
	//
	// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
	AttrNetworkProtocolName    network.AttrProtocolName    `otel:"network.protocol.name"`    // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion `otel:"network.protocol.version"` // The [URI scheme] component identifying the used protocol
	//
	// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	AttrUrlScheme url.AttrScheme `otel:"url.scheme"` // The low-cardinality template of an [absolute path reference]
	//
	// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
	AttrUrlTemplate url.AttrTemplate `otel:"url.template"`
}

func (ClientRequestDurationExtra) ErrorType

func (ClientRequestDurationExtra) HttpResponseStatusCode

func (a ClientRequestDurationExtra) HttpResponseStatusCode() AttrResponseStatusCode

func (ClientRequestDurationExtra) NetworkProtocolName

func (a ClientRequestDurationExtra) NetworkProtocolName() network.AttrProtocolName

func (ClientRequestDurationExtra) NetworkProtocolVersion

func (a ClientRequestDurationExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ClientRequestDurationExtra) UrlScheme

func (ClientRequestDurationExtra) UrlTemplate

type ClientResponseBodySize

type ClientResponseBodySize struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

Size of HTTP client response bodies.

func NewClientResponseBodySize

func NewClientResponseBodySize() ClientResponseBodySize

func (ClientResponseBodySize) With

func (m ClientResponseBodySize) With(requestMethod AttrRequestMethod, address server.AttrAddress, port server.AttrPort, extras ...interface {
	ErrorType() error.AttrType
	HttpResponseStatusCode() AttrResponseStatusCode
	NetworkProtocolName() network.AttrProtocolName
	UrlTemplate() url.AttrTemplate
	NetworkProtocolVersion() network.AttrProtocolVersion
	UrlScheme() url.AttrScheme
}) prometheus.Observer

func (ClientResponseBodySize) WithErrorType

func (a ClientResponseBodySize) WithErrorType(attr interface{ ErrorType() error.AttrType }) ClientResponseBodySize

func (ClientResponseBodySize) WithLabelValues deprecated

func (m ClientResponseBodySize) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ClientResponseBodySize.With instead

func (ClientResponseBodySize) WithNetworkProtocolName

func (a ClientResponseBodySize) WithNetworkProtocolName(attr interface {
	NetworkProtocolName() network.AttrProtocolName
}) ClientResponseBodySize

func (ClientResponseBodySize) WithNetworkProtocolVersion

func (a ClientResponseBodySize) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ClientResponseBodySize

func (ClientResponseBodySize) WithResponseStatusCode

func (a ClientResponseBodySize) WithResponseStatusCode(attr interface{ HttpResponseStatusCode() AttrResponseStatusCode }) ClientResponseBodySize

func (ClientResponseBodySize) WithUrlScheme

func (a ClientResponseBodySize) WithUrlScheme(attr interface{ UrlScheme() url.AttrScheme }) ClientResponseBodySize

func (ClientResponseBodySize) WithUrlTemplate

func (a ClientResponseBodySize) WithUrlTemplate(attr interface{ UrlTemplate() url.AttrTemplate }) ClientResponseBodySize

type ClientResponseBodySizeExtra

type ClientResponseBodySizeExtra struct {
	// Describes a class of error the operation ended with
	AttrErrorType error.AttrType `otel:"error.type"` // [HTTP response status code]
	//
	// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
	AttrResponseStatusCode AttrResponseStatusCode `otel:"http.response.status_code"` // [OSI application layer] or non-OSI equivalent
	//
	// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
	AttrNetworkProtocolName network.AttrProtocolName `otel:"network.protocol.name"` // The low-cardinality template of an [absolute path reference]
	//
	// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
	AttrUrlTemplate            url.AttrTemplate            `otel:"url.template"`             // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion `otel:"network.protocol.version"` // The [URI scheme] component identifying the used protocol
	//
	// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	AttrUrlScheme url.AttrScheme `otel:"url.scheme"`
}

func (ClientResponseBodySizeExtra) ErrorType

func (ClientResponseBodySizeExtra) HttpResponseStatusCode

func (a ClientResponseBodySizeExtra) HttpResponseStatusCode() AttrResponseStatusCode

func (ClientResponseBodySizeExtra) NetworkProtocolName

func (a ClientResponseBodySizeExtra) NetworkProtocolName() network.AttrProtocolName

func (ClientResponseBodySizeExtra) NetworkProtocolVersion

func (a ClientResponseBodySizeExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ClientResponseBodySizeExtra) UrlScheme

func (ClientResponseBodySizeExtra) UrlTemplate

type Metrics

type Metrics struct {
	Active       ServerActiveRequests
	ResponseSize ServerResponseBodySize
	RequestSize  ServerRequestBodySize
	Duration     ServerRequestDuration
}

func Register

func Register(reg prometheus.Registerer) Metrics

type ServerActiveRequests

type ServerActiveRequests struct {
	*prometheus.GaugeVec
	// contains filtered or unexported fields
}

Number of active HTTP server requests.

func NewServerActiveRequests

func NewServerActiveRequests() ServerActiveRequests

func (ServerActiveRequests) With

func (m ServerActiveRequests) With(requestMethod AttrRequestMethod, scheme url.AttrScheme, extras ...interface {
	ServerAddress() server.AttrAddress
	ServerPort() server.AttrPort
}) prometheus.Gauge

func (ServerActiveRequests) WithLabelValues deprecated

func (m ServerActiveRequests) WithLabelValues(lvs ...string) prometheus.Gauge

Deprecated: Use ServerActiveRequests.With instead

func (ServerActiveRequests) WithServerAddress

func (a ServerActiveRequests) WithServerAddress(attr interface{ ServerAddress() server.AttrAddress }) ServerActiveRequests

func (ServerActiveRequests) WithServerPort

func (a ServerActiveRequests) WithServerPort(attr interface{ ServerPort() server.AttrPort }) ServerActiveRequests

type ServerActiveRequestsExtra

type ServerActiveRequestsExtra struct {
	// Name of the local HTTP server that received the request
	AttrServerAddress server.AttrAddress `otel:"server.address"` // Port of the local HTTP server that received the request
	AttrServerPort    server.AttrPort    `otel:"server.port"`
}

func (ServerActiveRequestsExtra) ServerAddress

func (a ServerActiveRequestsExtra) ServerAddress() server.AttrAddress

func (ServerActiveRequestsExtra) ServerPort

func (a ServerActiveRequestsExtra) ServerPort() server.AttrPort

type ServerRequestBodySize

type ServerRequestBodySize struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

Size of HTTP server request bodies.

func NewServerRequestBodySize

func NewServerRequestBodySize() ServerRequestBodySize

func (ServerRequestBodySize) With

func (m ServerRequestBodySize) With(requestMethod AttrRequestMethod, scheme url.AttrScheme, extras ...interface {
	ErrorType() error.AttrType
	HttpResponseStatusCode() AttrResponseStatusCode
	HttpRoute() AttrRoute
	NetworkProtocolName() network.AttrProtocolName
	NetworkProtocolVersion() network.AttrProtocolVersion
	ServerAddress() server.AttrAddress
	ServerPort() server.AttrPort
	UserAgentSyntheticType() user_agent.AttrSyntheticType
}) prometheus.Observer

func (ServerRequestBodySize) WithErrorType

func (a ServerRequestBodySize) WithErrorType(attr interface{ ErrorType() error.AttrType }) ServerRequestBodySize

func (ServerRequestBodySize) WithLabelValues deprecated

func (m ServerRequestBodySize) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ServerRequestBodySize.With instead

func (ServerRequestBodySize) WithNetworkProtocolName

func (a ServerRequestBodySize) WithNetworkProtocolName(attr interface {
	NetworkProtocolName() network.AttrProtocolName
}) ServerRequestBodySize

func (ServerRequestBodySize) WithNetworkProtocolVersion

func (a ServerRequestBodySize) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ServerRequestBodySize

func (ServerRequestBodySize) WithResponseStatusCode

func (a ServerRequestBodySize) WithResponseStatusCode(attr interface{ HttpResponseStatusCode() AttrResponseStatusCode }) ServerRequestBodySize

func (ServerRequestBodySize) WithRoute

func (a ServerRequestBodySize) WithRoute(attr interface{ HttpRoute() AttrRoute }) ServerRequestBodySize

func (ServerRequestBodySize) WithServerAddress

func (a ServerRequestBodySize) WithServerAddress(attr interface{ ServerAddress() server.AttrAddress }) ServerRequestBodySize

func (ServerRequestBodySize) WithServerPort

func (a ServerRequestBodySize) WithServerPort(attr interface{ ServerPort() server.AttrPort }) ServerRequestBodySize

func (ServerRequestBodySize) WithUserAgentSyntheticType

func (a ServerRequestBodySize) WithUserAgentSyntheticType(attr interface {
	UserAgentSyntheticType() user_agent.AttrSyntheticType
}) ServerRequestBodySize

type ServerRequestBodySizeExtra

type ServerRequestBodySizeExtra struct {
	// Describes a class of error the operation ended with
	AttrErrorType error.AttrType `otel:"error.type"` // [HTTP response status code]
	//
	// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
	AttrResponseStatusCode AttrResponseStatusCode `otel:"http.response.status_code"` // The matched route, that is, the path template in the format used by the respective server framework
	AttrRoute              AttrRoute              `otel:"http.route"`                // [OSI application layer] or non-OSI equivalent
	//
	// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
	AttrNetworkProtocolName    network.AttrProtocolName     `otel:"network.protocol.name"`    // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion  `otel:"network.protocol.version"` // Name of the local HTTP server that received the request
	AttrServerAddress          server.AttrAddress           `otel:"server.address"`           // Port of the local HTTP server that received the request
	AttrServerPort             server.AttrPort              `otel:"server.port"`              // Specifies the category of synthetic traffic, such as tests or bots
	AttrUserAgentSyntheticType user_agent.AttrSyntheticType `otel:"user_agent.synthetic.type"`
}

func (ServerRequestBodySizeExtra) ErrorType

func (ServerRequestBodySizeExtra) HttpResponseStatusCode

func (a ServerRequestBodySizeExtra) HttpResponseStatusCode() AttrResponseStatusCode

func (ServerRequestBodySizeExtra) HttpRoute

func (a ServerRequestBodySizeExtra) HttpRoute() AttrRoute

func (ServerRequestBodySizeExtra) NetworkProtocolName

func (a ServerRequestBodySizeExtra) NetworkProtocolName() network.AttrProtocolName

func (ServerRequestBodySizeExtra) NetworkProtocolVersion

func (a ServerRequestBodySizeExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ServerRequestBodySizeExtra) ServerAddress

func (a ServerRequestBodySizeExtra) ServerAddress() server.AttrAddress

func (ServerRequestBodySizeExtra) ServerPort

func (ServerRequestBodySizeExtra) UserAgentSyntheticType

func (a ServerRequestBodySizeExtra) UserAgentSyntheticType() user_agent.AttrSyntheticType

type ServerRequestDuration

type ServerRequestDuration struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

Duration of HTTP server requests.

func NewServerRequestDuration

func NewServerRequestDuration() ServerRequestDuration

func (ServerRequestDuration) With

func (m ServerRequestDuration) With(requestMethod AttrRequestMethod, scheme url.AttrScheme, extras ...interface {
	ErrorType() error.AttrType
	HttpResponseStatusCode() AttrResponseStatusCode
	HttpRoute() AttrRoute
	NetworkProtocolName() network.AttrProtocolName
	NetworkProtocolVersion() network.AttrProtocolVersion
	ServerAddress() server.AttrAddress
	ServerPort() server.AttrPort
	UserAgentSyntheticType() user_agent.AttrSyntheticType
}) prometheus.Observer

func (ServerRequestDuration) WithErrorType

func (a ServerRequestDuration) WithErrorType(attr interface{ ErrorType() error.AttrType }) ServerRequestDuration

func (ServerRequestDuration) WithLabelValues deprecated

func (m ServerRequestDuration) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ServerRequestDuration.With instead

func (ServerRequestDuration) WithNetworkProtocolName

func (a ServerRequestDuration) WithNetworkProtocolName(attr interface {
	NetworkProtocolName() network.AttrProtocolName
}) ServerRequestDuration

func (ServerRequestDuration) WithNetworkProtocolVersion

func (a ServerRequestDuration) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ServerRequestDuration

func (ServerRequestDuration) WithResponseStatusCode

func (a ServerRequestDuration) WithResponseStatusCode(attr interface{ HttpResponseStatusCode() AttrResponseStatusCode }) ServerRequestDuration

func (ServerRequestDuration) WithRoute

func (a ServerRequestDuration) WithRoute(attr interface{ HttpRoute() AttrRoute }) ServerRequestDuration

func (ServerRequestDuration) WithServerAddress

func (a ServerRequestDuration) WithServerAddress(attr interface{ ServerAddress() server.AttrAddress }) ServerRequestDuration

func (ServerRequestDuration) WithServerPort

func (a ServerRequestDuration) WithServerPort(attr interface{ ServerPort() server.AttrPort }) ServerRequestDuration

func (ServerRequestDuration) WithUserAgentSyntheticType

func (a ServerRequestDuration) WithUserAgentSyntheticType(attr interface {
	UserAgentSyntheticType() user_agent.AttrSyntheticType
}) ServerRequestDuration

type ServerRequestDurationExtra

type ServerRequestDurationExtra struct {
	// Describes a class of error the operation ended with
	AttrErrorType error.AttrType `otel:"error.type"` // [HTTP response status code]
	//
	// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
	AttrResponseStatusCode AttrResponseStatusCode `otel:"http.response.status_code"` // The matched route, that is, the path template in the format used by the respective server framework
	AttrRoute              AttrRoute              `otel:"http.route"`                // [OSI application layer] or non-OSI equivalent
	//
	// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
	AttrNetworkProtocolName    network.AttrProtocolName     `otel:"network.protocol.name"`    // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion  `otel:"network.protocol.version"` // Name of the local HTTP server that received the request
	AttrServerAddress          server.AttrAddress           `otel:"server.address"`           // Port of the local HTTP server that received the request
	AttrServerPort             server.AttrPort              `otel:"server.port"`              // Specifies the category of synthetic traffic, such as tests or bots
	AttrUserAgentSyntheticType user_agent.AttrSyntheticType `otel:"user_agent.synthetic.type"`
}

func (ServerRequestDurationExtra) ErrorType

func (ServerRequestDurationExtra) HttpResponseStatusCode

func (a ServerRequestDurationExtra) HttpResponseStatusCode() AttrResponseStatusCode

func (ServerRequestDurationExtra) HttpRoute

func (a ServerRequestDurationExtra) HttpRoute() AttrRoute

func (ServerRequestDurationExtra) NetworkProtocolName

func (a ServerRequestDurationExtra) NetworkProtocolName() network.AttrProtocolName

func (ServerRequestDurationExtra) NetworkProtocolVersion

func (a ServerRequestDurationExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ServerRequestDurationExtra) ServerAddress

func (a ServerRequestDurationExtra) ServerAddress() server.AttrAddress

func (ServerRequestDurationExtra) ServerPort

func (ServerRequestDurationExtra) UserAgentSyntheticType

func (a ServerRequestDurationExtra) UserAgentSyntheticType() user_agent.AttrSyntheticType

type ServerResponseBodySize

type ServerResponseBodySize struct {
	*prometheus.HistogramVec
	// contains filtered or unexported fields
}

Size of HTTP server response bodies.

func NewServerResponseBodySize

func NewServerResponseBodySize() ServerResponseBodySize

func (ServerResponseBodySize) With

func (m ServerResponseBodySize) With(requestMethod AttrRequestMethod, scheme url.AttrScheme, extras ...interface {
	ErrorType() error.AttrType
	HttpResponseStatusCode() AttrResponseStatusCode
	HttpRoute() AttrRoute
	NetworkProtocolName() network.AttrProtocolName
	NetworkProtocolVersion() network.AttrProtocolVersion
	ServerAddress() server.AttrAddress
	ServerPort() server.AttrPort
	UserAgentSyntheticType() user_agent.AttrSyntheticType
}) prometheus.Observer

func (ServerResponseBodySize) WithErrorType

func (a ServerResponseBodySize) WithErrorType(attr interface{ ErrorType() error.AttrType }) ServerResponseBodySize

func (ServerResponseBodySize) WithLabelValues deprecated

func (m ServerResponseBodySize) WithLabelValues(lvs ...string) prometheus.Observer

Deprecated: Use ServerResponseBodySize.With instead

func (ServerResponseBodySize) WithNetworkProtocolName

func (a ServerResponseBodySize) WithNetworkProtocolName(attr interface {
	NetworkProtocolName() network.AttrProtocolName
}) ServerResponseBodySize

func (ServerResponseBodySize) WithNetworkProtocolVersion

func (a ServerResponseBodySize) WithNetworkProtocolVersion(attr interface {
	NetworkProtocolVersion() network.AttrProtocolVersion
}) ServerResponseBodySize

func (ServerResponseBodySize) WithResponseStatusCode

func (a ServerResponseBodySize) WithResponseStatusCode(attr interface{ HttpResponseStatusCode() AttrResponseStatusCode }) ServerResponseBodySize

func (ServerResponseBodySize) WithRoute

func (a ServerResponseBodySize) WithRoute(attr interface{ HttpRoute() AttrRoute }) ServerResponseBodySize

func (ServerResponseBodySize) WithServerAddress

func (a ServerResponseBodySize) WithServerAddress(attr interface{ ServerAddress() server.AttrAddress }) ServerResponseBodySize

func (ServerResponseBodySize) WithServerPort

func (a ServerResponseBodySize) WithServerPort(attr interface{ ServerPort() server.AttrPort }) ServerResponseBodySize

func (ServerResponseBodySize) WithUserAgentSyntheticType

func (a ServerResponseBodySize) WithUserAgentSyntheticType(attr interface {
	UserAgentSyntheticType() user_agent.AttrSyntheticType
}) ServerResponseBodySize

type ServerResponseBodySizeExtra

type ServerResponseBodySizeExtra struct {
	// Describes a class of error the operation ended with
	AttrErrorType error.AttrType `otel:"error.type"` // [HTTP response status code]
	//
	// [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6
	AttrResponseStatusCode AttrResponseStatusCode `otel:"http.response.status_code"` // The matched route, that is, the path template in the format used by the respective server framework
	AttrRoute              AttrRoute              `otel:"http.route"`                // [OSI application layer] or non-OSI equivalent
	//
	// [OSI application layer]: https://wikipedia.org/wiki/Application_layer
	AttrNetworkProtocolName    network.AttrProtocolName     `otel:"network.protocol.name"`    // The actual version of the protocol used for network communication
	AttrNetworkProtocolVersion network.AttrProtocolVersion  `otel:"network.protocol.version"` // Name of the local HTTP server that received the request
	AttrServerAddress          server.AttrAddress           `otel:"server.address"`           // Port of the local HTTP server that received the request
	AttrServerPort             server.AttrPort              `otel:"server.port"`              // Specifies the category of synthetic traffic, such as tests or bots
	AttrUserAgentSyntheticType user_agent.AttrSyntheticType `otel:"user_agent.synthetic.type"`
}

func (ServerResponseBodySizeExtra) ErrorType

func (ServerResponseBodySizeExtra) HttpResponseStatusCode

func (a ServerResponseBodySizeExtra) HttpResponseStatusCode() AttrResponseStatusCode

func (ServerResponseBodySizeExtra) HttpRoute

func (a ServerResponseBodySizeExtra) HttpRoute() AttrRoute

func (ServerResponseBodySizeExtra) NetworkProtocolName

func (a ServerResponseBodySizeExtra) NetworkProtocolName() network.AttrProtocolName

func (ServerResponseBodySizeExtra) NetworkProtocolVersion

func (a ServerResponseBodySizeExtra) NetworkProtocolVersion() network.AttrProtocolVersion

func (ServerResponseBodySizeExtra) ServerAddress

func (ServerResponseBodySizeExtra) ServerPort

func (ServerResponseBodySizeExtra) UserAgentSyntheticType

func (a ServerResponseBodySizeExtra) UserAgentSyntheticType() user_agent.AttrSyntheticType

Jump to

Keyboard shortcuts

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