MCPcopy Create free account
hub / github.com/coder/coder / RecordInterception

Method RecordInterception

aibridge/recorder/recorder.go:29–45  ·  view source on GitHub ↗
(ctx context.Context, req *InterceptionRecord)

Source from the content-addressed store, hash-verified

27}
28
29func (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
47func (r *WrappedRecorder) RecordInterceptionEnded(ctx context.Context, req *InterceptionRecordEnded) (outErr error) {
48 ctx, span := r.tracer.Start(ctx, "Intercept.RecordInterceptionEnded", trace.WithAttributes(tracing.InterceptionAttributesFromContext(ctx)...))

Callers

nothing calls this directly

Calls 6

EndSpanErrFunction · 0.92
StartMethod · 0.65
RecordInterceptionMethod · 0.65
ErrorfMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected