Skip to content

[pkg/ottl] Support the expression of "time of day" #29468

Closed
@gracework

Description

@gracework

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 with Now()) and then edit it to a particular time, instead of editing by time.Duration? Now() seems useful here because it can create a starting point for "today"
  • Is there a way to convert a time.Time to a string? Then I could regex, substring, or edit it and then convert it from a string back to a time.Time to compare it against start_time or end_time

Additional context

If anyone has any ideas on how to accomplish this task with the existing OTTL, I would sure appreciate it 😃

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions