annotateFilesystemSpan stamps the operation kind and target path onto the active runtime.tool.handler span. Paths ship unconditionally — they're the main signal of what the agent touched. Drop or hash `cagent.tool.filesystem.path` at the OTel collector if paths routinely reveal identifiers you don't
(ctx context.Context, op, path string)
| 35 | // `cagent.tool.filesystem.path` at the OTel collector if paths |
| 36 | // routinely reveal identifiers you don't want shipped. |
| 37 | func annotateFilesystemSpan(ctx context.Context, op, path string) { |
| 38 | span := trace.SpanFromContext(ctx) |
| 39 | if !span.IsRecording() { |
| 40 | return |
| 41 | } |
| 42 | attrs := []attribute.KeyValue{ |
| 43 | attribute.String("cagent.tool.filesystem.op", op), |
| 44 | } |
| 45 | if path != "" { |
| 46 | attrs = append(attrs, attribute.String("cagent.tool.filesystem.path", path)) |
| 47 | } |
| 48 | span.SetAttributes(attrs...) |
| 49 | } |
| 50 | |
| 51 | // maxFilesystemPathsAttr caps how many entries from args.Paths land on a |
| 52 | // span attribute. Many backends drop attributes over a few KiB and per- |
no test coverage detected