Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion flow/alerting/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"time"

"github.com/ClickHouse/clickhouse-go/v2"
"github.com/davecgh/go-spew/spew"
"github.com/go-mysql-org/go-mysql/mysql"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgconn"
Expand Down Expand Up @@ -445,6 +446,11 @@ const (
flowErrorTypeError flowErrorType = "error"
)

var errSpew = spew.ConfigState{
Indent: " ",
DisableMethods: true, // Don't call Error() method, show the actual fields
}

// logFlowErrorInternal pushes the error to the errors table and emits a metric as well as a telemetry message
func (a *Alerter) logFlowErrorInternal(
ctx context.Context,
Expand All @@ -456,7 +462,9 @@ func (a *Alerter) logFlowErrorInternal(
logger := internal.LoggerFromCtx(ctx)
inErrWithStack := fmt.Sprintf("%+v", inErr)
errError := inErr.Error()
loggerFunc(errError, slog.String("stack", inErrWithStack))
loggerFunc(errError,
slog.String("stack", inErrWithStack),
slog.String("spew", errSpew.Sdump(inErr)))
if _, err := a.CatalogPool.Exec(
ctx, "INSERT INTO peerdb_stats.flow_errors(flow_name,error_message,error_type) VALUES($1,$2,$3)",
flowName, inErrWithStack, errorType.String(),
Expand Down
4 changes: 2 additions & 2 deletions flow/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ require (

require (
cel.dev/expr v0.24.0 // indirect
cloud.google.com/go/auth v0.17.0 // indirect
cloud.google.com/go/auth v0.17.0
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.3 // indirect
Expand Down Expand Up @@ -143,7 +143,7 @@ require (
github.com/coreos/go-systemd/v22 v22.6.0 // indirect
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/danieljoos/wincred v1.2.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand Down
Loading