Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
edmocosta opened this issue Feb 24, 2025 · 5 comments · May be fixed by #38264
Open

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

edmocosta opened this issue Feb 24, 2025 · 5 comments · May be fixed by #38264
Labels
enhancement New feature or request pkg/ottl priority:p2 Medium

Comments

@edmocosta
Copy link
Contributor

edmocosta commented Feb 24, 2025

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

@edmocosta edmocosta added enhancement New feature or request needs triage New item requiring triage labels Feb 24, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@VihasMakwana
Copy link
Contributor

This sounds like a valid enhancement and I'm removing the needs triage label. Let's wait on codeowners

@VihasMakwana VihasMakwana added waiting-for-code-owners and removed needs triage New item requiring triage labels Feb 26, 2025
@odubajDT
Copy link
Contributor

Hi, I would like to take this if possible

@VihasMakwana VihasMakwana assigned odubajDT and unassigned odubajDT Feb 27, 2025
@VihasMakwana
Copy link
Contributor

@TylerHelmuth, let me know if you're handling this one. If not, I can assign it to @odubajDT.

@odubajDT odubajDT linked a pull request Feb 28, 2025 that will close this issue
@odubajDT
Copy link
Contributor

Should be ready for review #38264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg/ottl priority:p2 Medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants