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

Support rollups for specific spans #1174

Open
cartermp opened this issue May 25, 2024 · 1 comment
Open

Support rollups for specific spans #1174

cartermp opened this issue May 25, 2024 · 1 comment
Labels
type: enhancement New feature or request

Comments

@cartermp
Copy link
Member

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

Consider code in a tight loop, or really any component that can get called a lot. If there's a span emitted each time, then you end up with a potentially high volume of spans carrying little useful information within them.

It is very often the case that this is a bug, or the instrumentation wasn't quite done right, but you may need an intervention right now to keep your event volume under control.

Describe the solution you'd like

I would be great to have a configuration in my rules where I could specify the name of a span and explicitly roll up all instances within a trace to be a single span with some aggregate stats on it:

# Entries are names of spans which will be collapsed into a single span
# that contains a few aggregate statistics on it.
rollups: [my.noisy.span]

The statistics could be:

  • sum of spans
  • sum of span durations
  • avg/pXX span duration
  • sum of errors

Perhaps more, but those are likely to be the most useful.

Describe alternatives you've considered

The "right" way to approach this problem is typically to reinstrument. However, that may not be possible for a period of time, and this is a good way to curb event volume right now until such a time that a better intervention can be chosen.

Additional context

This would help at least one of our very large customers.

@cartermp cartermp added the type: enhancement New feature or request label May 25, 2024
@cartermp
Copy link
Member Author

An alternative design for this is not to rollup all specific spans by name within a trace, but specify the name of a parent span and roll up all its children:

rollups:
  # does a rollup of all children under my.parent.name that writes aggregate info into that parent span
  - type: parent_rollup
    parent_name: my.parent.name
  # creates a single parent span representing the aggregate of my.noisy.span
  - type: rollup
    name: my.noisy.span

I don't think there's a way to express "roll up all children under this parent" in the OTel Collector today.

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

No branches or pull requests

1 participant