Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Dec 22, 2023
1 parent 0a86a30 commit d668ec3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions flow/shared/alerting/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ func (a *Alerter) AddAlertToCatalog(ctx context.Context, alertKey string, alertM
func (a *Alerter) LogFlowError(ctx context.Context, flowName string, err error) {
errorWithStack := fmt.Sprintf("%+v", err)
_, err = a.catalogPool.Exec(ctx,
"INSERT INTO peerdb_stats.alerts_v1(alert_key,alert_message, flow_name) VALUES($1,$2,$3)",
"flow_error", errorWithStack, flowName)
"INSERT INTO peerdb_stats.flow_errors(flow_name,error_message,error_type) VALUES($1,$2,$3)",
flowName, errorWithStack, "error")
if err != nil {
a.logger.WarnContext(ctx, "failed to insert alert", slog.Any("error", err))
a.logger.WarnContext(ctx, "failed to insert flow error", slog.Any("error", err))
return
}
}
5 changes: 0 additions & 5 deletions nexus/catalog/migrations/V17__alert_has_mirror_opt.sql

This file was deleted.

10 changes: 10 additions & 0 deletions nexus/catalog/migrations/V17__mirror_errors.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE peerdb_stats.flow_errors (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
flow_name TEXT NOT NULL,
error_message TEXT NOT NULL,
error_type TEXT NOT NULL,
error_timestamp TIMESTAMP NOT NULL DEFAULT now(),
ack BOOLEAN NOT NULL DEFAULT FALSE
);

CREATE INDEX idx_flow_errors_flow_name ON peerdb_stats.flow_errors (flow_name);

0 comments on commit d668ec3

Please sign in to comment.