MCPcopy
hub / github.com/grafana/tempo / generateRandomBlob

Method generateRandomBlob

pkg/util/trace_info.go:217–224  ·  view source on GitHub ↗

generateRandomBlob returns a string of exactly size bytes of random data (same character set as other attributes).

(size int)

Source from the content-addressed store, hash-verified

215
216// generateRandomBlob returns a string of exactly size bytes of random data (same character set as other attributes).
217func (t *TraceInfo) generateRandomBlob(size int) string {
218 letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
219 s := make([]rune, size)
220 for i := 0; i < size; i++ {
221 s[i] = letters[t.r.Intn(len(letters))]
222 }
223 return string(s)
224}
225
226// generateFixedAttributesWithPrefix returns the fixed attributes with a prefix. Keys are lowercase with a hyphen before the numeric suffix (e.g. string-01, int-01, blob-01).
227func (t *TraceInfo) generateFixedAttributesWithPrefix(prefix string) []*jaeger.Tag {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected