Documentation ¶
Index ¶
- Constants
- Variables
- type AggregatedMetric
- type ConsumerMetricsManager
- type MetricService
- type ProviderMetrics
- type ProviderMetricsManager
- func (pme *ProviderMetricsManager) AddPayment(specID string, cu uint64)
- func (pme *ProviderMetricsManager) AddProviderMetrics(specID string, apiInterface string) *ProviderMetrics
- func (pme *ProviderMetricsManager) SetBlock(latestLavaBlock int64)
- func (pme *ProviderMetricsManager) SetLatestBlock(specID string, block uint64)
- type RPCConsumerLogs
- func (pl *RPCConsumerLogs) AddMetricForGrpc(data *RelayMetrics, err error, metadataValues *metadata.MD)
- func (pl *RPCConsumerLogs) AddMetricForHttp(data *RelayMetrics, err error, headers map[string]string)
- func (pl *RPCConsumerLogs) AddMetricForWebSocket(data *RelayMetrics, err error, c *websocket.Conn)
- func (pl *RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage(c *websocket.Conn, mt int, err error, msgSeed string, msg []byte, ...)
- func (pl *RPCConsumerLogs) GetMessageSeed() string
- func (pl *RPCConsumerLogs) GetUniqueGuidResponseForError(responseError error, msgSeed string) string
- func (pl *RPCConsumerLogs) LogRequestAndResponse(module string, hasError bool, method string, path string, req string, ...)
- func (pl *RPCConsumerLogs) LogStartTransaction(name string) func()
- func (rpccl *RPCConsumerLogs) LogTestMode(fiberCtx *fiber.Ctx)
- 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"
)
Variables ¶
View Source
var ReturnMaskedErrors = "false"
Functions ¶
This section is empty.
Types ¶
type AggregatedMetric ¶
type ConsumerMetricsManager ¶
type ConsumerMetricsManager struct {
// contains filtered or unexported fields
}
func NewConsumerMetricsManager ¶
func NewConsumerMetricsManager(networkAddress string) *ConsumerMetricsManager
func (*ConsumerMetricsManager) SetBlock ¶
func (pme *ConsumerMetricsManager) SetBlock(block int64)
func (*ConsumerMetricsManager) SetRelayMetrics ¶
func (pme *ConsumerMetricsManager) SetRelayMetrics(relayMetric *RelayMetrics)
type MetricService ¶
type MetricService struct { AggregatedMetricMap *map[string]map[string]map[string]map[RelaySource]*AggregatedMetric MetricsChannel chan RelayMetrics ReportUrl 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 string, 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 string, apiInterface string) *ProviderMetrics
func (*ProviderMetricsManager) SetBlock ¶
func (pme *ProviderMetricsManager) SetBlock(latestLavaBlock int64)
func (*ProviderMetricsManager) SetLatestBlock ¶
func (pme *ProviderMetricsManager) SetLatestBlock(specID string, block uint64)
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 (pl *RPCConsumerLogs) AddMetricForGrpc(data *RelayMetrics, err error, metadataValues *metadata.MD)
func (*RPCConsumerLogs) AddMetricForHttp ¶
func (pl *RPCConsumerLogs) AddMetricForHttp(data *RelayMetrics, err error, headers map[string]string)
func (*RPCConsumerLogs) AddMetricForWebSocket ¶
func (pl *RPCConsumerLogs) AddMetricForWebSocket(data *RelayMetrics, err error, c *websocket.Conn)
func (*RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage ¶
func (pl *RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage(c *websocket.Conn, mt int, err error, msgSeed string, msg []byte, rpcType string)
Websocket healthy disconnections throw "websocket: close 1005 (no status)" error, We dont want to alert error monitoring for that purpses.
func (*RPCConsumerLogs) GetMessageSeed ¶
func (pl *RPCConsumerLogs) GetMessageSeed() string
func (*RPCConsumerLogs) GetUniqueGuidResponseForError ¶
func (pl *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 (pl *RPCConsumerLogs) LogStartTransaction(name string) func()
func (*RPCConsumerLogs) LogTestMode ¶
func (rpccl *RPCConsumerLogs) LogTestMode(fiberCtx *fiber.Ctx)
type RelayAnalyticsDTO ¶
type RelayMetrics ¶
type RelayMetrics struct { ProjectHash string Timestamp time.Time ChainID string APIType string Latency int64 Success bool ComputeUnits uint64 Source RelaySource }
func NewRelayAnalytics ¶
func NewRelayAnalytics(projectHash string, chainId string, 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.