opentelemetry-collector-contrib
opentelemetry-collector-contrib copied to clipboard
Add custom time format configuration option
Is your feature request related to a problem? Please describe. Opentelemetry stores time in timestamps with nanoseconds. But different storages or later processing may expect time in some different format. This is request to add custom time format to telemetry data. Custom time field could be just another attribute.
Describe the solution you'd like There're different places where adding attribute in desired time format could be added:
- attribute processor (but should be extended to accept Timestamp field)
- transform processor (but it works with TQL functions only, so not sure)
- together with stanza time_parser
Custom time format is most useful for logs, since variety of log formats, so stanza time_parser looks more suitable for me. But I'd like to listen if this could be interesting to somebody else in some different place.
Describe alternatives you've considered no
Additional context no
Added implementation of this idea - https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/12977
This is request to add custom time format to telemetry data.
If I'm understanding correctly, you want a mechanism that will format a timestamp according to a custom format and write the resulting string value to a specified field.
I think this functionality would need to be implemented in the transformprocessor, and that it would need to be generic enough to apply to any pdata.Timestamp field. (Logs, metrics, and traces all have more than one timestamp field in their data models.)
I don't think it would be appropriate to implement this within pkg/stanza, since this is focused on log ingestion. That is not to say that the timestamp format logic could not be reused.
My suggestion is that we need a detailed proposal for a transform processor function.
Pinging code owners: @TylerHelmuth @kentquirk @bogdandrutu. See Adding Labels via Comments if you do not have permissions to add labels yourself.
I think a factory function could be created in the telemetry query language that could take a Path that returns a timestamp and converts it to a string based on a supplied format.
Thanks for suggestions! Let me take a closer look at TQL.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
Pinging code owners:
- processor/transform: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
See Adding Labels via Comments if you do not have permissions to add labels yourself.
This issue has been closed as inactive because it has been stale for 120 days with no activity.