Skip to content

Commit

Permalink
fix: error not propagating properly
Browse files Browse the repository at this point in the history
- also attempt to add information from context
  • Loading branch information
iamKunalGupta committed Mar 1, 2024
1 parent 5966adc commit a686d22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flow/shared/alerting/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ func (a *Alerter) checkAndAddAlertToCatalog(ctx context.Context, alertKey string
return false
}

func (a *Alerter) sendTelemetryMessage(ctx context.Context, flowName string, more any, level telemetry.Level) {
func (a *Alerter) sendTelemetryMessage(ctx context.Context, flowName string, more string, level telemetry.Level) {
if a.telemetrySender != nil {
details := fmt.Sprintf("[%s] %s", flowName, more)
_, err := a.telemetrySender.SendMessage(ctx, details, details, telemetry.Attributes{
_, err := a.telemetrySender.SendMessage(ctx, details, fmt.Sprintf("%s\n%+v", details, ctx), telemetry.Attributes{
Level: level,
DeploymentUID: peerdbenv.PeerDBDeploymentUID(),
Tags: []string{flowName},
Expand All @@ -234,7 +234,7 @@ func (a *Alerter) LogFlowError(ctx context.Context, flowName string, err error)
logger.LoggerFromCtx(ctx).Warn("failed to insert flow error", slog.Any("error", err))
return
}
a.sendTelemetryMessage(ctx, flowName, err, telemetry.ERROR)
a.sendTelemetryMessage(ctx, flowName, errorWithStack, telemetry.ERROR)
}

func (a *Alerter) LogFlowEvent(ctx context.Context, flowName string, info string) {
Expand Down

0 comments on commit a686d22

Please sign in to comment.