(ctx context.Context, req *InterceptionRecord)
| 27 | } |
| 28 | |
| 29 | func (r *WrappedRecorder) RecordInterception(ctx context.Context, req *InterceptionRecord) (outErr error) { |
| 30 | ctx, span := r.tracer.Start(ctx, "Intercept.RecordInterception", trace.WithAttributes(tracing.InterceptionAttributesFromContext(ctx)...)) |
| 31 | defer tracing.EndSpanErr(span, &outErr) |
| 32 | |
| 33 | client, err := r.clientFn() |
| 34 | if err != nil { |
| 35 | return xerrors.Errorf("acquire client: %w", err) |
| 36 | } |
| 37 | |
| 38 | req.StartedAt = time.Now() |
| 39 | if err = client.RecordInterception(ctx, req); err == nil { |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | r.logger.Warn(ctx, "failed to record interception", slog.Error(err), slog.F("interception_id", req.ID)) |
| 44 | return err |
| 45 | } |
| 46 | |
| 47 | func (r *WrappedRecorder) RecordInterceptionEnded(ctx context.Context, req *InterceptionRecordEnded) (outErr error) { |
| 48 | ctx, span := r.tracer.Start(ctx, "Intercept.RecordInterceptionEnded", trace.WithAttributes(tracing.InterceptionAttributesFromContext(ctx)...)) |
nothing calls this directly
no test coverage detected