probeProxy emits a [PROBE/proxy] log tagged with a stable conn id and phase name. Cheap to call when the probe is off (single atomic load + early return); zero allocations on the hot disabled path.
(logger *zap.Logger, phase string, connID int64, fields ...zap.Field)
| 67 | // and phase name. Cheap to call when the probe is off (single atomic |
| 68 | // load + early return); zero allocations on the hot disabled path. |
| 69 | func probeProxy(logger *zap.Logger, phase string, connID int64, fields ...zap.Field) { |
| 70 | if !probeOn() { |
| 71 | return |
| 72 | } |
| 73 | base := []zap.Field{ |
| 74 | zap.String("probe", "proxy"), |
| 75 | zap.String("phase", phase), |
| 76 | zap.Int64("connID", connID), |
| 77 | zap.Int64("ts_ns", time.Now().UnixNano()), |
| 78 | } |
| 79 | logger.Info("[PROBE/proxy]", append(base, fields...)...) |
| 80 | } |
| 81 | |
| 82 | var defaultMysqlPorts = []uint32{3306, 4000} |
| 83 |
no test coverage detected