MCPcopy Index your code
hub / github.com/docker/cli / filterResourceAttributes

Function filterResourceAttributes

cli/command/telemetry.go:257–279  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

255const dockerCLIAttributePrefix = "docker.cli."
256
257func filterResourceAttributes(s string) string {
258 if trimmed := strings.TrimSpace(s); trimmed == "" {
259 return trimmed
260 }
261
262 pairs := strings.Split(s, ",")
263 elems := make([]string, 0, len(pairs))
264 for _, p := range pairs {
265 k, _, found := strings.Cut(p, "=")
266 if !found {
267 // Do not interact with invalid otel resources.
268 elems = append(elems, p)
269 continue
270 }
271
272 // Skip attributes that have our docker.cli prefix.
273 if strings.HasPrefix(k, dockerCLIAttributePrefix) {
274 continue
275 }
276 elems = append(elems, p)
277 }
278 return strings.Join(elems, ",")
279}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…