Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
e316a923
Commit
e316a923
authored
Jan 24, 2026
by
song
Browse files
fix(ops): count failover kinds with suffix
parent
fd0370c0
Changes
2
Show whitespace changes
Inline
Side-by-side
backend/internal/repository/ops_repo_trends.go
View file @
e316a923
...
@@ -59,7 +59,7 @@ error_buckets AS (
...
@@ -59,7 +59,7 @@ error_buckets AS (
switch_buckets AS (
switch_buckets AS (
SELECT `
+
errorBucketExpr
+
` AS bucket,
SELECT `
+
errorBucketExpr
+
` AS bucket,
COALESCE(SUM(CASE
COALESCE(SUM(CASE
WHEN ev->>'kind' IN ('failover', 'retry_exhausted_failover', 'failover_on_400') THEN 1
WHEN
split_part(
ev->>'kind'
, ':', 1)
IN ('failover', 'retry_exhausted_failover', 'failover_on_400') THEN 1
ELSE 0
ELSE 0
END), 0) AS switch_count
END), 0) AS switch_count
FROM ops_error_logs
FROM ops_error_logs
...
...
backend/internal/service/ops_metrics_collector.go
View file @
e316a923
...
@@ -561,7 +561,7 @@ func (c *OpsMetricsCollector) queryAccountSwitchCount(ctx context.Context, start
...
@@ -561,7 +561,7 @@ func (c *OpsMetricsCollector) queryAccountSwitchCount(ctx context.Context, start
q
:=
`
q
:=
`
SELECT
SELECT
COALESCE(SUM(CASE
COALESCE(SUM(CASE
WHEN ev->>'kind' IN ('failover', 'retry_exhausted_failover', 'failover_on_400') THEN 1
WHEN
split_part(
ev->>'kind'
, ':', 1)
IN ('failover', 'retry_exhausted_failover', 'failover_on_400') THEN 1
ELSE 0
ELSE 0
END), 0) AS switch_count
END), 0) AS switch_count
FROM ops_error_logs o
FROM ops_error_logs o
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment