Skip to content

Commit

Permalink
Tag SSH connection failures as err:Net (#2406)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Dubé <[email protected]>
  • Loading branch information
iskakaushik and serprex authored Jan 2, 2025
1 parent 565d54e commit ff1f11d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flow/alerting/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/jackc/pgx/v5/pgconn"
"github.com/jackc/pgx/v5/pgxpool"
"go.temporal.io/sdk/log"
"golang.org/x/crypto/ssh"

"github.com/PeerDB-io/peer-flow/generated/protos"
"github.com/PeerDB-io/peer-flow/peerdbenv"
Expand Down Expand Up @@ -456,6 +457,12 @@ func (a *Alerter) LogFlowError(ctx context.Context, flowName string, err error)
if errors.As(err, &netErr) {
tags = append(tags, string(shared.ErrTypeNet))
}
// For SSH connection errors, we currently tag them as "err:Net"
var sshErr *ssh.OpenChannelError
if errors.As(err, &sshErr) {
tags = append(tags, string(shared.ErrTypeNet))
}

a.sendTelemetryMessage(ctx, logger, flowName, errorWithStack, telemetry.ERROR, tags...)
}

Expand Down

0 comments on commit ff1f11d

Please sign in to comment.