Documentation
¶
Overview ¶
Package telemetry provides a set of functions for incrementing counters which track various events across the codebase. Typically, calls to these counter functions SHOULD be made inside deferred anonymous functions so that they will reference the final values of their inputs. Any instrumented piece of code which contains branching logic with respect its counter function inputs is subject to this constraint (i.e. MUST defer).
Index ¶
- Variables
- func ClaimComputeUnitsCounter(claimProofStage prooftypes.ClaimProofStage, numComputeUnits uint64, err error)
- func ClaimCounter(claimProofStage prooftypes.ClaimProofStage, numClaims uint64, err error)
- func ClaimRelaysCounter(claimProofStage prooftypes.ClaimProofStage, numRelays uint64, err error)
- func EventSuccessCounter(eventType string, getValue func() float32, isSuccessful func() bool)
- func InitBlockMetrics(app *baseapp.BaseApp)
- func ProofRequirementCounter(reason prooftypes.ProofRequirementReason, err error)
- func RelayEMAGauge(relayEMA uint64, serviceId string)
- func RelayMiningDifficultyGauge(difficulty float32, serviceId string)
Constants ¶
This section is empty.
Variables ¶
var (
DefaultCounterFn = func() float32 { return 1 }
)
Functions ¶
func ClaimComputeUnitsCounter ¶ added in v0.0.3
func ClaimComputeUnitsCounter( claimProofStage prooftypes.ClaimProofStage, numComputeUnits uint64, err error, )
ClaimComputeUnitsCounter increments a counter which tracks the number of compute units which are represented by on-chain claims at the given ClaimProofStage. If err is not nil, the counter is not incremented but Prometheus will ingest this event.
func ClaimCounter ¶ added in v0.0.3
func ClaimCounter( claimProofStage prooftypes.ClaimProofStage, numClaims uint64, err error, )
ClaimCounter increments a counter which tracks the number of claims at the given ClaimProofStage. If err is not nil, the counter is not incremented but Prometheus will ingest this event.
func ClaimRelaysCounter ¶ added in v0.0.4
func ClaimRelaysCounter( claimProofStage prooftypes.ClaimProofStage, numRelays uint64, err error, )
ClaimRelaysCounter increments a counter which tracks the number of relays represented by on-chain claims at the given ClaimProofStage. If err is not nil, the counter is not incremented and an "error" label is added with the error's message. I.e., Prometheus will ingest this event.
func EventSuccessCounter ¶
EventSuccessCounter increments a counter with the given data type and success status.
func InitBlockMetrics ¶
InitBlockMetrics initializes the block-specific metrics for the application.
func ProofRequirementCounter ¶ added in v0.0.3
func ProofRequirementCounter( reason prooftypes.ProofRequirementReason, err error, )
ProofRequirementCounter increments a counter which tracks the number of claims which require proof for the given proof requirement reason (i.e. not required, probabilistic selection, above compute unit threshold). If err is not nil, the counter is not incremented but Prometheus will ingest this event.
func RelayEMAGauge ¶ added in v0.0.3
RelayEMAGauge sets a gauge which tracks the relay EMA for a service. The serviceId is used as a label to be able to track the EMA for each service.
func RelayMiningDifficultyGauge ¶ added in v0.0.3
RelayMiningDifficultyGauge sets a gauge which tracks the integer representation of the relay mining difficulty. The serviceId is used as a label to be able to track the difficulty for each service.
Types ¶
This section is empty.