Open jdeff opened 1 week ago
cc @TylerHelmuth
Pinging code owners for processor/transform: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.
Do you want those logs to be transformed into metric data?
The ability to convert regular units to another unit is generally useful. I think a more generic function that takes an input and converts to a desired output would be most generally useful.
Warning, there are some weird edge cases with converting when you need to support stuff like mb
, M
, and Mi
. It was so annoying we ended up writing a solution ourselves instead of using a library
@jdeff can you propose what a function would look like to be able to convert 10917.88MB
to any format?
Component(s)
OTTL
Is your feature request related to a problem? Please describe.
Heroku emits log lines containing metrics data for the various dyno instances running for an application. These log lines look similar to:
Using the
syslog_receiver
and key_value_parser you can get something almost useable. However, the values are still strings of human readable byte sizes (e.g. "68.20MB") and need to converted to an integer number of bytes in order for them to be useable.Describe the solution you'd like
I would like to be able to parse these byte size values using the transformprocessor, which I am already using to shape other values, and convert them to an integer value of bytes. I propose adding a
ParseBytes
function to OTTL in the same vain asParseJson
andParseCsv
. This could be used with the following config:Describe alternatives you've considered
I've looked at simply striping the units from these values, but the units are not guaranteed to be the same.
ParseBytes
may be an ambiguous or confusing name (though it is what is used by go-humanize). Something likeParsePrettyByteSize
orParseHumanizedByteString
might be clearer.Additional context
No response