go.temporal.io/server/common/wideevents/attrs.go

18 LOC · 4 covered · 14 uncovered · 1 ranges · 4 concepts · 1 introducers · 3 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

1 package wideevents
2
3 import (
4 "encoding/json"
5 "fmt"
6
7 "go.opentelemetry.io/otel/log"
8 )
9
10 // jsonAttr records v as a compact JSON string under key rather than a nested structure, so the
11 // logging / ingestion layer keeps one low-cardinality field (e.g. details) instead of flattening
12 // into a dynamic key per leaf path. Used for composite fields (maps/slices/whole objects).
13 > func jsonAttr(key string, v any) log.KeyValue { attrs.go ×1
14 > if b, err := json.Marshal(v); err == nil {
15 > return log.String(key, string(b))
16 > }
17 return log.String(key, fmt.Sprintf("%v", v))
18 }