MCPcopy Create free account
hub / github.com/cockroachdb/errors / GetTelemetryKeys

Function GetTelemetryKeys

telemetrykeys/telemetrykeys.go:38–52  ·  view source on GitHub ↗

GetTelemetryKeys retrieves the (de-duplicated) set of all telemetry keys present in the direct causal chain of the error. The keys may not be sorted.

(err error)

Source from the content-addressed store, hash-verified

36// all telemetry keys present in the direct causal chain
37// of the error. The keys may not be sorted.
38func GetTelemetryKeys(err error) []string {
39 keys := map[string]struct{}{}
40 for ; err != nil; err = errbase.UnwrapOnce(err) {
41 if w, ok := err.(*withTelemetry); ok {
42 for _, k := range w.keys {
43 keys[k] = struct{}{}
44 }
45 }
46 }
47 res := make([]string, 0, len(keys))
48 for k := range keys {
49 res = append(res, k)
50 }
51 return res
52}

Callers 2

GetTelemetryKeysFunction · 0.92
TestTelemetryFunction · 0.92

Calls 1

UnwrapOnceFunction · 0.92

Tested by 1

TestTelemetryFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…