Skip to content

Commit 0c73cd9

Browse files
update: changing opentel next
Signed-off-by: Naman-B-Parlecha <[email protected]>
1 parent 5104a47 commit 0c73cd9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

execution/telemetry/telemetry.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,18 @@ func (t *Operator) Series(ctx context.Context) ([]labels.Labels, error) {
203203

204204
func (t *Operator) Next(ctx context.Context) ([]model.StepVector, error) {
205205
start := time.Now()
206+
totalSamplesBefore := t.OperatorTelemetry.Samples().TotalSamples
207+
206208
defer func() { t.OperatorTelemetry.AddNextExecutionTime(time.Since(start)) }()
207-
return t.inner.Next(ctx)
209+
out, err := t.inner.Next(ctx)
210+
if err != nil {
211+
return nil, err
212+
}
213+
214+
totalSamplesAfter := t.OperatorTelemetry.Samples().TotalSamples
215+
t.OperatorTelemetry.Samples().UpdatePeak(int(totalSamplesAfter) - int(totalSamplesBefore))
216+
217+
return out, err
208218
}
209219

210220
func (t *Operator) GetPool() *model.VectorPool {

0 commit comments

Comments
 (0)