Skip to content

[pkg/ottl] Support Weekday for time.Time's in OTTL #38126

Closed
@edmocosta

Description

@edmocosta

Component(s)

pkg/ottl

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

Currently, OTTL does not support extracting the week day from a time.Time value.

Describe the solution you'd like

Create a new converter Weekday, similar to other's time.Time related converters (Day, Month, Year, etc.).
Ideally, It should return the weekday as an integer (0-6), so users can easily filtering data based on that value, including values range.

Describe alternatives you've considered

The FormatTime converter can be used as an alternative:

- FormatTime(time, "%a") != "Mon"

Although it works, using the FormatTime converter makes it hard to filter by ranges (e.g from "Mon" to "Thu").

Additional context

#38122

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions