open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.71k stars 2.14k forks source link

[pkg/ottl] Adding support for locale into our time parsing library #32977

Open michalpristas opened 1 month ago

michalpristas commented 1 month ago

Component(s)

pkg/ottl

Is your feature request related to a problem? Please describe.

This is a followup to #32140

When timestamp is in non-english language normal golang parsing will fail.

example: when the tool i'm observing is producing Italian logs in a form of mercoledì set 4 2024 parsing with a layout Monday Jan 2 2006 should yield 4th September 2024 correctly

Describe the solution you'd like

Similar support as implemented in https://github.com/ruang-guru/monday for our stanza time library

We could use CLDR data and generate mapping using ca-generic.json file from specified locale to English.

then use golang standard library to parse translated English date

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 1 month ago

Pinging code owners: