rpcconv

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0, BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientDuration

type ClientDuration struct {
	metric.Float64Histogram
}

ClientDuration is an instrument used to record metric values conforming to the "rpc.client.duration" semantic conventions. It represents the measures the duration of outbound RPC.

func NewClientDuration

func NewClientDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ClientDuration, error)

NewClientDuration returns a new ClientDuration instrument.

func (ClientDuration) Description

func (ClientDuration) Description() string

Description returns the semantic convention description of the instrument

func (ClientDuration) Inst

Inst returns the underlying metric instrument.

func (ClientDuration) Name

func (ClientDuration) Name() string

Name returns the semantic convention name of the instrument.

func (ClientDuration) Record

func (m ClientDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

While streaming RPCs may record this metric as start-of-batch to end-of-batch, it's hard to interpret in practice.

**Streaming**: N/A.

func (ClientDuration) Unit

func (ClientDuration) Unit() string

Unit returns the semantic convention unit of the instrument

type ClientRequestSize

type ClientRequestSize struct {
	metric.Int64Histogram
}

ClientRequestSize is an instrument used to record metric values conforming to the "rpc.client.request.size" semantic conventions. It represents the measures the size of RPC request messages (uncompressed).

func NewClientRequestSize

func NewClientRequestSize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ClientRequestSize, error)

NewClientRequestSize returns a new ClientRequestSize instrument.

func (ClientRequestSize) Description

func (ClientRequestSize) Description() string

Description returns the semantic convention description of the instrument

func (ClientRequestSize) Inst

Inst returns the underlying metric instrument.

func (ClientRequestSize) Name

func (ClientRequestSize) Name() string

Name returns the semantic convention name of the instrument.

func (ClientRequestSize) Record

func (m ClientRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

**Streaming**: Recorded per message in a streaming batch

func (ClientRequestSize) Unit

func (ClientRequestSize) Unit() string

Unit returns the semantic convention unit of the instrument

type ClientRequestsPerRPC

type ClientRequestsPerRPC struct {
	metric.Int64Histogram
}

ClientRequestsPerRPC is an instrument used to record metric values conforming to the "rpc.client.requests_per_rpc" semantic conventions. It represents the measures the number of messages received per RPC.

func NewClientRequestsPerRPC

func NewClientRequestsPerRPC(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ClientRequestsPerRPC, error)

NewClientRequestsPerRPC returns a new ClientRequestsPerRPC instrument.

func (ClientRequestsPerRPC) Description

func (ClientRequestsPerRPC) Description() string

Description returns the semantic convention description of the instrument

func (ClientRequestsPerRPC) Inst

Inst returns the underlying metric instrument.

func (ClientRequestsPerRPC) Name

Name returns the semantic convention name of the instrument.

func (ClientRequestsPerRPC) Record

func (m ClientRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

Should be 1 for all non-streaming RPCs.

**Streaming**: This metric is required for server and client streaming RPCs

func (ClientRequestsPerRPC) Unit

Unit returns the semantic convention unit of the instrument

type ClientResponseSize

type ClientResponseSize struct {
	metric.Int64Histogram
}

ClientResponseSize is an instrument used to record metric values conforming to the "rpc.client.response.size" semantic conventions. It represents the measures the size of RPC response messages (uncompressed).

func NewClientResponseSize

func NewClientResponseSize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ClientResponseSize, error)

NewClientResponseSize returns a new ClientResponseSize instrument.

func (ClientResponseSize) Description

func (ClientResponseSize) Description() string

Description returns the semantic convention description of the instrument

func (ClientResponseSize) Inst

Inst returns the underlying metric instrument.

func (ClientResponseSize) Name

func (ClientResponseSize) Name() string

Name returns the semantic convention name of the instrument.

func (ClientResponseSize) Record

func (m ClientResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

**Streaming**: Recorded per response in a streaming batch

func (ClientResponseSize) Unit

func (ClientResponseSize) Unit() string

Unit returns the semantic convention unit of the instrument

type ClientResponsesPerRPC

type ClientResponsesPerRPC struct {
	metric.Int64Histogram
}

ClientResponsesPerRPC is an instrument used to record metric values conforming to the "rpc.client.responses_per_rpc" semantic conventions. It represents the measures the number of messages sent per RPC.

func NewClientResponsesPerRPC

func NewClientResponsesPerRPC(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ClientResponsesPerRPC, error)

NewClientResponsesPerRPC returns a new ClientResponsesPerRPC instrument.

func (ClientResponsesPerRPC) Description

func (ClientResponsesPerRPC) Description() string

Description returns the semantic convention description of the instrument

func (ClientResponsesPerRPC) Inst

Inst returns the underlying metric instrument.

func (ClientResponsesPerRPC) Name

Name returns the semantic convention name of the instrument.

func (ClientResponsesPerRPC) Record

func (m ClientResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

Should be 1 for all non-streaming RPCs.

**Streaming**: This metric is required for server and client streaming RPCs

func (ClientResponsesPerRPC) Unit

Unit returns the semantic convention unit of the instrument

type ServerDuration

type ServerDuration struct {
	metric.Float64Histogram
}

ServerDuration is an instrument used to record metric values conforming to the "rpc.server.duration" semantic conventions. It represents the measures the duration of inbound RPC.

func NewServerDuration

func NewServerDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ServerDuration, error)

NewServerDuration returns a new ServerDuration instrument.

func (ServerDuration) Description

func (ServerDuration) Description() string

Description returns the semantic convention description of the instrument

func (ServerDuration) Inst

Inst returns the underlying metric instrument.

func (ServerDuration) Name

func (ServerDuration) Name() string

Name returns the semantic convention name of the instrument.

func (ServerDuration) Record

func (m ServerDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

While streaming RPCs may record this metric as start-of-batch to end-of-batch, it's hard to interpret in practice.

**Streaming**: N/A.

func (ServerDuration) Unit

func (ServerDuration) Unit() string

Unit returns the semantic convention unit of the instrument

type ServerRequestSize

type ServerRequestSize struct {
	metric.Int64Histogram
}

ServerRequestSize is an instrument used to record metric values conforming to the "rpc.server.request.size" semantic conventions. It represents the measures the size of RPC request messages (uncompressed).

func NewServerRequestSize

func NewServerRequestSize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ServerRequestSize, error)

NewServerRequestSize returns a new ServerRequestSize instrument.

func (ServerRequestSize) Description

func (ServerRequestSize) Description() string

Description returns the semantic convention description of the instrument

func (ServerRequestSize) Inst

Inst returns the underlying metric instrument.

func (ServerRequestSize) Name

func (ServerRequestSize) Name() string

Name returns the semantic convention name of the instrument.

func (ServerRequestSize) Record

func (m ServerRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

**Streaming**: Recorded per message in a streaming batch

func (ServerRequestSize) Unit

func (ServerRequestSize) Unit() string

Unit returns the semantic convention unit of the instrument

type ServerRequestsPerRPC

type ServerRequestsPerRPC struct {
	metric.Int64Histogram
}

ServerRequestsPerRPC is an instrument used to record metric values conforming to the "rpc.server.requests_per_rpc" semantic conventions. It represents the measures the number of messages received per RPC.

func NewServerRequestsPerRPC

func NewServerRequestsPerRPC(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ServerRequestsPerRPC, error)

NewServerRequestsPerRPC returns a new ServerRequestsPerRPC instrument.

func (ServerRequestsPerRPC) Description

func (ServerRequestsPerRPC) Description() string

Description returns the semantic convention description of the instrument

func (ServerRequestsPerRPC) Inst

Inst returns the underlying metric instrument.

func (ServerRequestsPerRPC) Name

Name returns the semantic convention name of the instrument.

func (ServerRequestsPerRPC) Record

func (m ServerRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

Should be 1 for all non-streaming RPCs.

**Streaming** : This metric is required for server and client streaming RPCs

func (ServerRequestsPerRPC) Unit

Unit returns the semantic convention unit of the instrument

type ServerResponseSize

type ServerResponseSize struct {
	metric.Int64Histogram
}

ServerResponseSize is an instrument used to record metric values conforming to the "rpc.server.response.size" semantic conventions. It represents the measures the size of RPC response messages (uncompressed).

func NewServerResponseSize

func NewServerResponseSize(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ServerResponseSize, error)

NewServerResponseSize returns a new ServerResponseSize instrument.

func (ServerResponseSize) Description

func (ServerResponseSize) Description() string

Description returns the semantic convention description of the instrument

func (ServerResponseSize) Inst

Inst returns the underlying metric instrument.

func (ServerResponseSize) Name

func (ServerResponseSize) Name() string

Name returns the semantic convention name of the instrument.

func (ServerResponseSize) Record

func (m ServerResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

**Streaming**: Recorded per response in a streaming batch

func (ServerResponseSize) Unit

func (ServerResponseSize) Unit() string

Unit returns the semantic convention unit of the instrument

type ServerResponsesPerRPC

type ServerResponsesPerRPC struct {
	metric.Int64Histogram
}

ServerResponsesPerRPC is an instrument used to record metric values conforming to the "rpc.server.responses_per_rpc" semantic conventions. It represents the measures the number of messages sent per RPC.

func NewServerResponsesPerRPC

func NewServerResponsesPerRPC(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (ServerResponsesPerRPC, error)

NewServerResponsesPerRPC returns a new ServerResponsesPerRPC instrument.

func (ServerResponsesPerRPC) Description

func (ServerResponsesPerRPC) Description() string

Description returns the semantic convention description of the instrument

func (ServerResponsesPerRPC) Inst

Inst returns the underlying metric instrument.

func (ServerResponsesPerRPC) Name

Name returns the semantic convention name of the instrument.

func (ServerResponsesPerRPC) Record

func (m ServerResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

Should be 1 for all non-streaming RPCs.

**Streaming**: This metric is required for server and client streaming RPCs

func (ServerResponsesPerRPC) Unit

Unit returns the semantic convention unit of the instrument