Skip to content

Commit 7461ad3

Browse files
committed
add documentation
1 parent 629d94b commit 7461ad3

File tree

1 file changed

+13
-0
lines changed
  • docs/platforms/go/common/tracing/instrumentation/custom-instrumentation

1 file changed

+13
-0
lines changed

docs/platforms/go/common/tracing/instrumentation/custom-instrumentation/index.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ Or you can add data attributes to an existing transaction or span:
6868
})
6969
```
7070

71+
Or you can update existing transaction and span data by:
72+
73+
```go
74+
if d := transaction.Data["dataAttr1"]; d != nil {
75+
transaction.SetData("dataAttr1", d.(int)+42)
76+
}
77+
78+
if d := span.Data["dataAttr1"]; d != nil {
79+
span.SetData("dataAttr1", d.(int)+42)
80+
}
81+
})
82+
```
83+
7184
To attach data attributes to the transaction and all its spans, you can use `BeforeSendTransaction`:
7285

7386
```go

0 commit comments

Comments
 (0)