data-prepper
data-prepper copied to clipboard
Add Duration support for Data Prepper Configuration using PluginDurationDeserializer
Is your feature request related to a problem? Please describe.
Currently, only piplelines.yaml can be deserialized using PluginDurationDeserializer. It doesn't allow DataPrepperConfiguration
to use Duration
.
Describe the solution you'd like
One solution I could think of is make PluginDurationDeserializer
a generic class instead of just for plugins and make it public. We can configure the object mapper of DataPrepperAppConfiguration here with custom deserializer.
Additionally, this can formalize the concept of a "Data Prepper duration". This is an input string that can be in the format of either an ISO-8601 string or expressed as "Ns" or "Nms" for a specified second or millisecond value.
Fixed as part of https://github.com/opensearch-project/data-prepper/pull/1757