Skip to content

Commit ea8dcfc

Browse files
committed
add comment for sql
1 parent 44aec40 commit ea8dcfc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

models/db/engine_hook.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ func (*EngineHook) BeforeProcess(c *contexts.ContextHook) (context.Context, erro
2929
func (h *EngineHook) AfterProcess(c *contexts.ContextHook) error {
3030
span := gtprof.GetContextSpan(c.Ctx)
3131
if span != nil {
32+
// Do not record SQL parameters here:
33+
// * It shouldn't expose the parameters because they contain sensitive information, end users need to report the trace details safely.
34+
// * Some parameters contain quite long texts, waste memory and are difficult to display.
3235
span.SetAttributeString(gtprof.TraceAttrDbSQL, c.SQL)
3336
span.End()
3437
} else {

0 commit comments

Comments
 (0)