MCPcopy Index your code
hub / github.com/keploy/keploy / probeHTTP

Function probeHTTP

pkg/agent/proxy/integrations/http/encode.go:45–57  ·  view source on GitHub ↗

probeHTTP emits a [PROBE/http] log tagged with the connID pulled from the parser context and a phase name. Cheap to call when the probe is off (single atomic load + early return).

(ctx context.Context, logger *zap.Logger, phase string, fields ...zap.Field)

Source from the content-addressed store, hash-verified

43// the parser context and a phase name. Cheap to call when the probe is
44// off (single atomic load + early return).
45func probeHTTP(ctx context.Context, logger *zap.Logger, phase string, fields ...zap.Field) {
46 if !probeHTTPOn() {
47 return
48 }
49 connID, _ := ctx.Value(models.ClientConnectionIDKey).(string)
50 base := []zap.Field{
51 zap.String("probe", "http"),
52 zap.String("phase", phase),
53 zap.String("connID", connID),
54 zap.Int64("ts_ns", time.Now().UnixNano()),
55 }
56 logger.Info("[PROBE/http]", append(base, fields...)...)
57}
58
59// encodeHTTP records outgoing HTTP traffic. The read/forward/chunked-handling
60// logic is identical to the original synchronous implementation. The only

Callers 1

encodeHTTPMethod · 0.85

Calls 2

probeHTTPOnFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected