You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Description
Currently `{TraceID,SpanID,ProfileID}` only support byte IDs, however in
open-telemetry#43429
it was brought up that it is difficult to take a string representation
of an ID and directly use that to set a trace ID. This would be for a
hexadecimal string representation comprising 32 bytes. This change
allows the `{TraceID,SpanID,ProfileID}` functions to also work on string
inputs.
In short, the following now works:
```yaml
statements:
- set(span.trace_id, TraceID("a389023abaa839283293ed323892389d"))
```
#### Link to tracking issue
Fixesopen-telemetry#43429
#### Testing
In addition to the included go tests the following config
[test-str-trace.yml](https://github.com/user-attachments/files/23217501/test-str-trace.yml)
was used to manually test by invoking `make otelcontribcol &&
./bin/otelcontribcol_darwin_arm64 --config test-str-trace.yml` in one
window and `telemetrygen traces --otlp-insecure --traces 1` in another.
The output is as shown:
<details>
<summary>CLI Output</summary>
```
Span #0
Trace ID : a389023abaa839283293ed323892389d
Parent ID : e5c516b0c8942eab
ID : 1914136d5f9ca838
Name : okey-dokey-0
Kind : Server
Start time : 2025-10-29 18:59:03.312829 +0000 UTC
End time : 2025-10-29 18:59:03.312952 +0000 UTC
Status code : Unset
Status message :
Attributes:
-> network.peer.address: Str(1.2.3.4)
-> peer.service: Str(telemetrygen-client)
Span #1
Trace ID : a389023abaa839283293ed323892389d
Parent ID :
ID : e5c516b0c8942eab
Name : lets-go
Kind : Client
Start time : 2025-10-29 18:59:03.312829 +0000 UTC
End time : 2025-10-29 18:59:03.312952 +0000 UTC
Status code : Unset
Status message :
Attributes:
-> network.peer.address: Str(1.2.3.4)
-> peer.service: Str(telemetrygen-server)
```
</details>
#### Documentation
I don't currently see documentation for these functions, but I'm new
here, maybe I'm missing something? Glad to update it
---------
Co-authored-by: Edmo Vamerlatti Costa <[email protected]>
0 commit comments