diff --git a/flow/alerting/alerting.go b/flow/alerting/alerting.go index 22bfd4757f..851ca07c99 100644 --- a/flow/alerting/alerting.go +++ b/flow/alerting/alerting.go @@ -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" @@ -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, @@ -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(), diff --git a/flow/go.mod b/flow/go.mod index b0934ac64e..fddcc60c12 100644 --- a/flow/go.mod +++ b/flow/go.mod @@ -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 @@ -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