Documentation ¶
Index ¶
- Constants
- Variables
- type AggregatedMetric
- type ConsumerMetricsManager
- func (pme *ConsumerMetricsManager) ResetQOSMetrics()
- func (pme *ConsumerMetricsManager) SetBlock(block int64)
- func (pme *ConsumerMetricsManager) SetQOSMetrics(chainId string, apiInterface string, providerAddress string, ...)
- func (pme *ConsumerMetricsManager) SetRelayMetrics(relayMetric *RelayMetrics, err error)
- type MetricService
- type ProviderMetrics
- type ProviderMetricsManager
- func (pme *ProviderMetricsManager) AddPayment(specID string, cu uint64)
- func (pme *ProviderMetricsManager) AddProviderMetrics(specID, apiInterface string) *ProviderMetrics
- func (pme *ProviderMetricsManager) SetBlock(latestLavaBlock int64)
- func (pme *ProviderMetricsManager) SetDisabledChain(specID string, apInterface string)
- func (pme *ProviderMetricsManager) SetEnabledChain(specID string, apInterface string)
- func (pme *ProviderMetricsManager) SetLatestBlock(specID string, block uint64)
- func (pme *ProviderMetricsManager) SetLatestBlockFetchError(specID string)
- func (pme *ProviderMetricsManager) SetLatestBlockFetchSuccess(specID string)
- func (pme *ProviderMetricsManager) SetSpecificBlockFetchError(specID string)
- func (pme *ProviderMetricsManager) SetSpecificBlockFetchSuccess(specID string)
- type RPCConsumerLogs
- func (rpccl *RPCConsumerLogs) AddMetricForGrpc(data *RelayMetrics, err error, metadataValues *metadata.MD)
- func (rpccl *RPCConsumerLogs) AddMetricForHttp(data *RelayMetrics, err error, headers map[string][]string)
- func (rpccl *RPCConsumerLogs) AddMetricForWebSocket(data *RelayMetrics, err error, c *websocket.Conn)
- func (rpccl *RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage(c *websocket.Conn, mt int, err error, msgSeed string, msg []byte, ...)
- func (rpccl *RPCConsumerLogs) GetMessageSeed() string
- func (rpccl *RPCConsumerLogs) GetUniqueGuidResponseForError(responseError error, msgSeed string) string
- func (rpccl *RPCConsumerLogs) LogRequestAndResponse(module string, hasError bool, method, path, req, resp, msgSeed string, ...)
- func (rpccl *RPCConsumerLogs) LogStartTransaction(name string) func()
- func (rpccl *RPCConsumerLogs) LogTestMode(fiberCtx *fiber.Ctx)
- func (rpccl *RPCConsumerLogs) SendMetrics(data *RelayMetrics, err error, origin string)
- type RelayAnalyticsDTO
- type RelayMetrics
- type RelaySource
Constants ¶
View Source
const ( AvailabilityLabel = "availability" SyncLabel = "sync/freshness" LatencyLabel = "latency" )
View Source
const ( MetricsListenFlagName = "metrics-listen-address" DisabledFlagOption = "disabled" )
View Source
const ( RefererHeaderKey = "Referer" OriginHeaderKey = "Origin" UserAgentHeaderKey = "User-Agent" )
Variables ¶
View Source
var ReturnMaskedErrors = "false"
Functions ¶
This section is empty.
Types ¶
type AggregatedMetric ¶
type ConsumerMetricsManager ¶
type ConsumerMetricsManager struct { LatestBlockMetric *prometheus.GaugeVec LatestProviderRelay *prometheus.GaugeVec // contains filtered or unexported fields }
func NewConsumerMetricsManager ¶
func NewConsumerMetricsManager(networkAddress string) *ConsumerMetricsManager
func (*ConsumerMetricsManager) ResetQOSMetrics ¶
func (pme *ConsumerMetricsManager) ResetQOSMetrics()
func (*ConsumerMetricsManager) SetBlock ¶
func (pme *ConsumerMetricsManager) SetBlock(block int64)
func (*ConsumerMetricsManager) SetQOSMetrics ¶
func (pme *ConsumerMetricsManager) SetQOSMetrics(chainId string, apiInterface string, providerAddress string, qos *pairingtypes.QualityOfServiceReport, qosExcellence *pairingtypes.QualityOfServiceReport, latestBlock int64, relays uint64)
func (*ConsumerMetricsManager) SetRelayMetrics ¶
func (pme *ConsumerMetricsManager) SetRelayMetrics(relayMetric *RelayMetrics, err error)
type MetricService ¶
type MetricService struct { AggregatedMetricMap *map[string]map[string]map[string]map[RelaySource]map[string]*AggregatedMetric MetricsChannel chan RelayMetrics ReportUrl string ReportAuthorization string }
func NewMetricService ¶
func NewMetricService() *MetricService
func (*MetricService) SendData ¶
func (m *MetricService) SendData(data RelayMetrics)
func (*MetricService) SendEachProjectMetricData ¶
func (m *MetricService) SendEachProjectMetricData()
type ProviderMetrics ¶
type ProviderMetrics struct {
// contains filtered or unexported fields
}
func NewProviderMetrics ¶
func NewProviderMetrics(specID, apiInterface string, totalCUServicedMetric *prometheus.CounterVec, totalCUPaidMetric *prometheus.CounterVec, totalRelaysServicedMetric *prometheus.CounterVec, totalErroredMetric *prometheus.CounterVec, consumerQoSMetric *prometheus.GaugeVec, ) *ProviderMetrics
func (*ProviderMetrics) AddError ¶
func (pm *ProviderMetrics) AddError()
func (*ProviderMetrics) AddPayment ¶
func (pm *ProviderMetrics) AddPayment(cu uint64)
func (*ProviderMetrics) AddRelay ¶
func (pm *ProviderMetrics) AddRelay(consumerAddress string, cu uint64, qos *pairingtypes.QualityOfServiceReport)
type ProviderMetricsManager ¶
type ProviderMetricsManager struct {
// contains filtered or unexported fields
}
func NewProviderMetricsManager ¶
func NewProviderMetricsManager(networkAddress string) *ProviderMetricsManager
func (*ProviderMetricsManager) AddPayment ¶
func (pme *ProviderMetricsManager) AddPayment(specID string, cu uint64)
func (*ProviderMetricsManager) AddProviderMetrics ¶
func (pme *ProviderMetricsManager) AddProviderMetrics(specID, apiInterface string) *ProviderMetrics
func (*ProviderMetricsManager) SetBlock ¶
func (pme *ProviderMetricsManager) SetBlock(latestLavaBlock int64)
func (*ProviderMetricsManager) SetDisabledChain ¶
func (pme *ProviderMetricsManager) SetDisabledChain(specID string, apInterface string)
func (*ProviderMetricsManager) SetEnabledChain ¶
func (pme *ProviderMetricsManager) SetEnabledChain(specID string, apInterface string)
func (*ProviderMetricsManager) SetLatestBlock ¶
func (pme *ProviderMetricsManager) SetLatestBlock(specID string, block uint64)
func (*ProviderMetricsManager) SetLatestBlockFetchError ¶
func (pme *ProviderMetricsManager) SetLatestBlockFetchError(specID string)
func (*ProviderMetricsManager) SetLatestBlockFetchSuccess ¶
func (pme *ProviderMetricsManager) SetLatestBlockFetchSuccess(specID string)
func (*ProviderMetricsManager) SetSpecificBlockFetchError ¶
func (pme *ProviderMetricsManager) SetSpecificBlockFetchError(specID string)
func (*ProviderMetricsManager) SetSpecificBlockFetchSuccess ¶
func (pme *ProviderMetricsManager) SetSpecificBlockFetchSuccess(specID string)
type RPCConsumerLogs ¶
type RPCConsumerLogs struct { MetricService *MetricService StoreMetricData bool // contains filtered or unexported fields }
func NewRPCConsumerLogs ¶
func NewRPCConsumerLogs(consumerMetricsManager *ConsumerMetricsManager) (*RPCConsumerLogs, error)
func (*RPCConsumerLogs) AddMetricForGrpc ¶
func (rpccl *RPCConsumerLogs) AddMetricForGrpc(data *RelayMetrics, err error, metadataValues *metadata.MD)
func (*RPCConsumerLogs) AddMetricForHttp ¶
func (rpccl *RPCConsumerLogs) AddMetricForHttp(data *RelayMetrics, err error, headers map[string][]string)
func (*RPCConsumerLogs) AddMetricForWebSocket ¶
func (rpccl *RPCConsumerLogs) AddMetricForWebSocket(data *RelayMetrics, err error, c *websocket.Conn)
func (*RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage ¶
func (rpccl *RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage(c *websocket.Conn, mt int, err error, msgSeed string, msg []byte, rpcType string, timeTaken time.Duration)
Websocket healthy disconnections throw "websocket: close 1005 (no status)" error, We dont want to alert error monitoring for that purpses.
func (*RPCConsumerLogs) GetMessageSeed ¶
func (rpccl *RPCConsumerLogs) GetMessageSeed() string
func (*RPCConsumerLogs) GetUniqueGuidResponseForError ¶
func (rpccl *RPCConsumerLogs) GetUniqueGuidResponseForError(responseError error, msgSeed string) string
Input will be masked with a random GUID if returnMaskedErrors is set to true
func (*RPCConsumerLogs) LogRequestAndResponse ¶
func (*RPCConsumerLogs) LogStartTransaction ¶
func (rpccl *RPCConsumerLogs) LogStartTransaction(name string) func()
func (*RPCConsumerLogs) LogTestMode ¶
func (rpccl *RPCConsumerLogs) LogTestMode(fiberCtx *fiber.Ctx)
func (*RPCConsumerLogs) SendMetrics ¶
func (rpccl *RPCConsumerLogs) SendMetrics(data *RelayMetrics, err error, origin string)
type RelayAnalyticsDTO ¶
type RelayMetrics ¶
type RelayMetrics struct { ProjectHash string Timestamp time.Time ChainID string APIType string Latency int64 Success bool ComputeUnits uint64 Source RelaySource Origin string }
func NewRelayAnalytics ¶
func NewRelayAnalytics(projectHash, chainId, apiType string) *RelayMetrics
type RelaySource ¶
type RelaySource int
const ( SdkSource RelaySource = iota + 1 GatewaySource BadgesSource )
Click to show internal directories.
Click to hide internal directories.