Closed
Description
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
or end_time
with a specific time of day. The OTTL functions related to time are for time.Duration
.
Describe alternatives you've considered
- Is there a way to create a
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" - Is there a way to convert a
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 😃