signalrconv

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 "signalr" namespace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionStatusAttr

type ConnectionStatusAttr string

ConnectionStatusAttr is an attribute conforming to the signalr.connection.status semantic conventions. It represents the signalR HTTP connection closure status.

var (
	// ConnectionStatusNormalClosure is the connection was closed normally.
	ConnectionStatusNormalClosure ConnectionStatusAttr = "normal_closure"
	// ConnectionStatusTimeout is the connection was closed due to a timeout.
	ConnectionStatusTimeout ConnectionStatusAttr = "timeout"
	// ConnectionStatusAppShutdown is the connection was closed because the app is
	// shutting down.
	ConnectionStatusAppShutdown ConnectionStatusAttr = "app_shutdown"
)

type ServerActiveConnections

type ServerActiveConnections struct {
	metric.Int64UpDownCounter
}

ServerActiveConnections is an instrument used to record metric values conforming to the "signalr.server.active_connections" semantic conventions. It represents the number of connections that are currently active on the server.

func NewServerActiveConnections

func NewServerActiveConnections(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (ServerActiveConnections, error)

NewServerActiveConnections returns a new ServerActiveConnections instrument.

func (ServerActiveConnections) Add

func (m ServerActiveConnections) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0

func (ServerActiveConnections) AttrConnectionStatus

AttrConnectionStatus returns an optional attribute for the "signalr.connection.status" semantic convention. It represents the signalR HTTP connection closure status.

func (ServerActiveConnections) AttrTransport

AttrTransport returns an optional attribute for the "signalr.transport" semantic convention. It represents the SignalR transport type.

func (ServerActiveConnections) Description

func (ServerActiveConnections) Description() string

Description returns the semantic convention description of the instrument

func (ServerActiveConnections) Inst

Inst returns the underlying metric instrument.

func (ServerActiveConnections) Name

Name returns the semantic convention name of the instrument.

func (ServerActiveConnections) Unit

Unit returns the semantic convention unit of the instrument

type ServerConnectionDuration

type ServerConnectionDuration struct {
	metric.Float64Histogram
}

ServerConnectionDuration is an instrument used to record metric values conforming to the "signalr.server.connection.duration" semantic conventions. It represents the duration of connections on the server.

func NewServerConnectionDuration

func NewServerConnectionDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ServerConnectionDuration, error)

NewServerConnectionDuration returns a new ServerConnectionDuration instrument.

func (ServerConnectionDuration) AttrConnectionStatus

AttrConnectionStatus returns an optional attribute for the "signalr.connection.status" semantic convention. It represents the signalR HTTP connection closure status.

func (ServerConnectionDuration) AttrTransport

AttrTransport returns an optional attribute for the "signalr.transport" semantic convention. It represents the SignalR transport type.

func (ServerConnectionDuration) Description

func (ServerConnectionDuration) Description() string

Description returns the semantic convention description of the instrument

func (ServerConnectionDuration) Inst

Inst returns the underlying metric instrument.

func (ServerConnectionDuration) Name

Name returns the semantic convention name of the instrument.

func (ServerConnectionDuration) Record

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

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0

func (ServerConnectionDuration) Unit

Unit returns the semantic convention unit of the instrument

type TransportAttr

type TransportAttr string

TransportAttr is an attribute conforming to the signalr.transport semantic conventions. It represents the SignalR transport type.

var (
	// TransportServerSentEvents is the serverSentEvents protocol.
	TransportServerSentEvents TransportAttr = "server_sent_events"
	// TransportLongPolling is the longPolling protocol.
	TransportLongPolling TransportAttr = "long_polling"
	// TransportWebSockets is the webSockets protocol.
	TransportWebSockets TransportAttr = "web_sockets"
)