Skip to content

Commit

Permalink
More metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Nov 23, 2024
1 parent f5c006f commit 785b59b
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions web/packages/operations/src/alarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ export const AlarmEvaluationConfiguration = {
ToEthereumStale: {
EvaluationPeriods: process.env["ToEthereumEvaluationPeriods"]
? parseInt(process.env["ToEthereumEvaluationPeriods"])
: 4,
: 5,
DatapointsToAlarm: process.env["ToEthereumDatapointsToAlarm"]
? parseInt(process.env["ToEthereumDatapointsToAlarm"])
: 3,
: 4,
},
ToPolkadotStale: {
EvaluationPeriods: process.env["ToPolkadotEvaluationPeriods"]
? parseInt(process.env["ToPolkadotEvaluationPeriods"])
: 3,
: 5,
DatapointsToAlarm: process.env["ToPolkadotDatapointsToAlarm"]
? parseInt(process.env["ToPolkadotDatapointsToAlarm"])
: 2,
: 4,
},
}

Expand All @@ -89,9 +89,7 @@ export const sendMetrics = async (metrics: status.AllMetrics) => {
metricData.push({
MetricName: AlarmReason.BeefyStale.toString(),
Value: Number(
metrics.bridgeStatus.toEthereum.blockLatency > BlockLatencyThreshold.ToEthereum &&
metrics.bridgeStatus.toEthereum.latestPolkadotBlockOnEthereum ==
metrics.bridgeStatus.toEthereum.previousPolkadotBlockOnEthereum
metrics.bridgeStatus.toEthereum.blockLatency > BlockLatencyThreshold.ToEthereum
),
})
// Beacon metrics
Expand All @@ -110,9 +108,7 @@ export const sendMetrics = async (metrics: status.AllMetrics) => {
metricData.push({
MetricName: AlarmReason.BeaconStale.toString(),
Value: Number(
metrics.bridgeStatus.toPolkadot.blockLatency > BlockLatencyThreshold.ToPolkadot &&
metrics.bridgeStatus.toPolkadot.latestBeaconSlotOnPolkadot ==
metrics.bridgeStatus.toPolkadot.previousEthereumBlockOnPolkadot
metrics.bridgeStatus.toPolkadot.blockLatency > BlockLatencyThreshold.ToPolkadot
),
})
// Channel metrics
Expand Down Expand Up @@ -162,6 +158,16 @@ export const sendMetrics = async (metrics: status.AllMetrics) => {
],
Value: channel.toEthereum.previousInbound,
})
metricData.push({
MetricName: "ToEthereumUndelivered",
Dimensions: [
{
Name: "ChannelName",
Value: channel.name,
},
],
Value: channel.toEthereum.outbound - channel.toEthereum.inbound,
})
metricData.push({
MetricName: AlarmReason.ToEthereumChannelStale.toString(),
Value: Number(
Expand Down Expand Up @@ -218,6 +224,16 @@ export const sendMetrics = async (metrics: status.AllMetrics) => {
],
Value: channel.toPolkadot.previousInbound,
})
metricData.push({
MetricName: "ToPolkadotUndelivered",
Dimensions: [
{
Name: "ChannelName",
Value: channel.name,
},
],
Value: channel.toPolkadot.outbound - channel.toPolkadot.inbound,
})
metricData.push({
MetricName: AlarmReason.ToPolkadotChannelStale.toString(),
Value: Number(
Expand Down

0 comments on commit 785b59b

Please sign in to comment.