Documentation
¶
Overview ¶
Package shannon provides functionality for exporting Shannon protocol metrics to Prometheus.
Index ¶
- Constants
- func ExtractDomainOrHost(rawURL string) (string, error)
- func ExtractTLDFromEndpointAddr(addr string) string
- func GetEndpointTLDs(endpoints protocol.EndpointAddrList) map[protocol.EndpointAddr]string
- func LogEndpointTLDDiversity(logger polylog.Logger, endpoints protocol.EndpointAddrList)
- func PublishMetrics(logger polylog.Logger, ...)
- func SetActiveHTTPRelays(activeCount int64)
- func SetActiveWebsocketConnections(activeCount int64)
Constants ¶
const (
// The default value for a domain if it cannot be extracted from an endpoint URL
ErrDomain = "error_extracting_domain"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractDomainOrHost ¶
ExtractDomainOrHost extracts the effective TLD+1 from a URL. It falls back to a reasonable domain extraction for localhost, IP addresses, and other non-standard hosts.
func ExtractTLDFromEndpointAddr ¶
ExtractTLDFromEndpointAddr extracts effective TLD+1 from endpoint address. Returns an empty string if the TLD cannot be determined.
func GetEndpointTLDs ¶
func GetEndpointTLDs(endpoints protocol.EndpointAddrList) map[protocol.EndpointAddr]string
GetEndpointTLDs extracts TLD information from endpoint addresses
func LogEndpointTLDDiversity ¶
func LogEndpointTLDDiversity(logger polylog.Logger, endpoints protocol.EndpointAddrList)
func PublishMetrics ¶
func PublishMetrics( logger polylog.Logger, observations *protocolobservations.ShannonObservationsList, )
PublishMetrics exports all Shannon-related Prometheus metrics using observations reported by the Shannon protocol.
func SetActiveHTTPRelays ¶
func SetActiveHTTPRelays(activeCount int64)
SetActiveHTTPRelays updates the gauge metric with the current number of active HTTP relays. This should be called whenever the active HTTP relay count changes in the concurrency limiter. TODO_TECHDEBT: the metrics package should use the passed observation to report metrics: it should not expose any methods for external usage (other than PublishMetrics)
func SetActiveWebsocketConnections ¶
func SetActiveWebsocketConnections(activeCount int64)
SetActiveWebsocketConnections updates the gauge metric with the current number of active Websocket connections. This should be called whenever the Websocket connection count changes.
Types ¶
This section is empty.