Skip to content

Commit 546f4fa

Browse files
dev SLO: fail job when throws any YDB exception. (All errors must be retried)
1 parent ad39d11 commit 546f4fa

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

slo/src/Internal/SloTableContext.cs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ async Task ShootingTask(RateLimiter rateLimitPolicy, string operationType, Func<
151151
"Total number of successful operations, categorized by type."
152152
);
153153

154-
var operationsFailureTotal = metricFactory.CreateCounter(
155-
"sdk_operations_failure_total",
156-
"Total number of failed operations, categorized by type."
157-
);
158-
159154
var operationLatencySeconds = metricFactory.CreateHistogram(
160155
"sdk_operation_latency_seconds",
161156
"Latency of operations performed by the SDK in seconds, categorized by type and status.",
@@ -210,23 +205,12 @@ async Task ShootingTask(RateLimiter rateLimitPolicy, string operationType, Func<
210205

211206
pendingOperations.Inc();
212207
var sw = Stopwatch.StartNew();
213-
try
214-
{
215-
await action(client, runConfig);
216-
sw.Stop();
217-
operationsTotal.Inc();
218-
pendingOperations.Dec();
219-
operationsSuccessTotal.Inc();
220-
operationLatencySeconds.WithLabels("success").Observe(sw.Elapsed.TotalSeconds);
221-
}
222-
catch (YdbException e)
223-
{
224-
Logger.LogError(e, "Fail operation!");
225-
226-
errorsTotal.WithLabels(e.Code.StatusName()).Inc();
227-
operationsFailureTotal.Inc();
228-
operationLatencySeconds.WithLabels("err").Observe(sw.Elapsed.TotalSeconds);
229-
}
208+
await action(client, runConfig);
209+
sw.Stop();
210+
operationsTotal.Inc();
211+
pendingOperations.Dec();
212+
operationsSuccessTotal.Inc();
213+
operationLatencySeconds.WithLabels("success").Observe(sw.Elapsed.TotalSeconds);
230214
}
231215
}, cancellationTokenSource.Token));
232216
}

0 commit comments

Comments
 (0)