Skip to content

Commit 83e5dc3

Browse files
refactor: disable telemetry error sender by default (#3395)
We already emit metrics and those metrics are used to alert internally/customers. There is no need to send alerts to incident.io via webhook by default
1 parent a408e4d commit 83e5dc3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

flow/alerting/alerting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ func (a *Alerter) logFlowErrorInternal(
498498
errorClass, errInfo := GetErrorClass(ctx, inErr)
499499
tags = append(tags, "errorClass:"+errorClass.String(), "errorAction:"+errorClass.ErrorAction().String())
500500

501-
if !internal.PeerDBTelemetryErrorActionBasedAlertingEnabled() || errorClass.ErrorAction() == NotifyTelemetry {
502-
// Warnings alert us just like errors until there's a customer warning system
501+
// Only send alerts to telemetry sender (incident.io) if the env is enabled
502+
if internal.PeerDBTelemetrySenderSendErrorAlertsEnabled() {
503503
a.sendTelemetryMessage(ctx, logger, flowName, inErrWithStack, telemetry.ERROR, tags...)
504504
}
505505
loggerFunc(fmt.Sprintf("Emitting error/warning metric: '%s'", inErr.Error()),

flow/internal/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ func PeerDBMaintenanceModeWaitAlertSeconds() int {
193193
return getEnvConvert("PEERDB_MAINTENANCE_MODE_WAIT_ALERT_SECONDS", 600, strconv.Atoi)
194194
}
195195

196-
func PeerDBTelemetryErrorActionBasedAlertingEnabled() bool {
197-
enabled, err := strconv.ParseBool(GetEnvString("PEERDB_TELEMETRY_ERROR_ACTION_BASED_ALERTING_ENABLED", "false"))
196+
// PEERDB_TELEMETRY_SENDER_SEND_ERROR_ALERTS_ENABLED is whether to send error alerts to the telemetry sender
197+
func PeerDBTelemetrySenderSendErrorAlertsEnabled() bool {
198+
enabled, err := strconv.ParseBool(GetEnvString("PEERDB_TELEMETRY_SENDER_SEND_ERROR_ALERTS_ENABLED", "false"))
198199
if err != nil {
199-
slog.Error("failed to parse PEERDB_TELEMETRY_ERROR_ACTION_BASED_ALERTING_ENABLED to bool", "error", err)
200+
slog.Error("failed to parse PEERDB_TELEMETRY_SENDER_SEND_ERROR_ALERTS_ENABLED to bool", "error", err)
200201
return false
201202
}
202203
return enabled

0 commit comments

Comments
 (0)