Skip to content

Variable sampling frequency for interval processor #37744

Open
@KalmanMeth

Description

@KalmanMeth

Component(s)

processor/interval

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

I have a use case where I would like to set different sampling rates for different metrics collected by the Collector.
For example, I may want most of the metrics to be updated once per minute, except for some specific metrics that I want to be updated every 10 seconds.

Describe the solution you'd like

A sample syntax of what I have in mind is:

intervalprocessor:
  [ interval: <duration> | default = 60s ]
  pass_through:
    [ gauge: <bool> | default = false ]
    [ summary: <boo>l | default = false ]
  [ rules:
    - name: <metric_name1>
      interval: <duration>
    - name: <metric_name2>
      interval: <duration>
    ...
  ]

The values of the <duration> specified in the rules would take precedence over the value specified in the default interval parameter.

Describe alternatives you've considered

I looked through the various processors, but I didn't find one that allows me such fine-grained control over the sampling frequencies for different metrics. I have implemented an approximate proof-of-concept and placed it at https://github.com/observ-vol-mgt/research-otel-collector/tree/main/processor/intervalprocessor, with the main code in https://github.com/observ-vol-mgt/research-otel-collector/blob/main/processor/intervalprocessor/processor.go.

Additional context

No response

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