-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTTL int to hex conversion function #31929
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@krokwen what are you using to collect the datadog logs that have a trace_id that is an uint64? |
It's not me, but our dev's =) and it's not a datadog logs, just regular app logs, json-serialized, including current trace and span IDs It's done like this in our Logging\DatadogHandler
I tried to poke a stick into it, examined few methods like \DDTrace\root_span() or \DDTrace\active_span() and didn't found there any hex-like notation, only stringified long integers |
->hexId() method is not available in my version of DDTrace, as I said before, the newer version breaks up the whole app... |
The OTTL grammar supports Byte Slices, represented as hex strings such as |
Looks like from what Tyler suggested this is a valid enhancement request, removing |
Hi, I would like to work on this issue cc @evan-bradley |
**Description:** <Describe what has changed.> Adds ByteSliceLikeGetter interface due to future support of Hex() converter **Link to tracking Issue:** #31929 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> --------- Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
**Description:** <Describe what has changed.> Adds a Hex function to the OTTL package. This function can be applied to following values: - float64 - string - bool - int64 - []byte The resulting value will be of type []byte. **Link to tracking Issue:** #31929 **Testing:** - unit tests - e2e tests Depends on #33536 --------- Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
I think this issue can be closed @TylerHelmuth @evan-bradley |
Closing as resolved via #33450. |
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
I'm unable to convert uint64 trace/span id to proper hex value during logs parsing
Describe the solution you'd like
Function name "Hex" that will accept two arguments:
second parameter is required to prepend the string with zeros to get the hex string of fixed length (trace_id.string and span_id.string accept only 32 char hex string, i'e 16-bytes)
Example:
Describe alternatives you've considered
I tried to convert trace id to hex on the PHP-side
It's not possible due to PHP is using signed int64, and in result a lot of trace ids become '7fffffffffffffff' when I trying to dechex((int) $ddTraceId)
The newer DDTrace (0.94+ or 0.96+) provides a method to acquire hex trace id (without leading zeros), but the newer extension breaks up my whole app for no reason (broken read from .env file...)
Additional context
Our laravel-based project uses DDTrace PHP-extension (0.88.1) for tracing purposes.
I can get traces easily using receiver/datadogreceiver (it processes trace_id internally by it's own)
But when I trying to parse application logs I have an issue with parsing of the datadog trace id which comes as uint64 that I unable to convert to hex value and write it as trace_id.string.
The text was updated successfully, but these errors were encountered: