-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 the expression of "time of day" #29468
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@gracework if we had a function like
|
@TylerHelmuth sure, I think that sounds functional! I'll probably have to do a bit of testing to confirm the correct hour (because timezones), but when is that not the case? :) |
Would something like
work here @gracework ? |
If that works, it is a good argument to have this function haha |
That's fair! I can take take this one |
**Description:** Adds `Hour` converter closes #29468 **Testing:** adds unit test **Documentation:** doc'd in readme for ottl converters --------- Co-authored-by: Evan Bradley <[email protected]>
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
We have OTel Collectors running in a development environment that send traces to an o11y vendor. Overnight, some processes run that generates spans that we don't need and no one ever looks at -- more than the daytime span volume.
Describe the solution you'd like
I would like to drop all telemetry during certain hours of the day / night.
This is a job for the filterprocessor, but I can't figure out how to compare a span's
start_time
orend_time
with a specific time of day. The OTTL functions related to time are fortime.Duration
.Describe alternatives you've considered
time.Time
object (such as withNow()
) and then edit it to a particular time, instead of editing bytime.Duration
?Now()
seems useful here because it can create a starting point for "today"time.Time
to astring
? Then I could regex, substring, or edit it and then convert it from a string back to atime.Time
to compare it againststart_time
orend_time
Additional context
If anyone has any ideas on how to accomplish this task with the existing OTTL, I would sure appreciate it 😃
The text was updated successfully, but these errors were encountered: