Skip to content

ExemplarReservoir default and performance hits #3952

@cijothomas

Description

@cijothomas

This talks about Exemplar defaults overall, this is a related, but different issue, related to Exemplars.

Based on stress tests/benchmarks in OTel .NET, turning on exemplars drops perf by 10-30% (For Histograms, the drop is less, but Counters/other-sync-instruments suffer the worst perf drop). As per the current wording, the default Reservoir to be used for every non Histograms is the SimpleFixedSizeExemplarReservoir.

Consider the following scenario:

  1. When a end users upgrades to the newer SDKs (supporting Exemplars), and turn the feature on (whether its on/off by default could be clarified separately), there is perf drop for all instruments. I think, a common scenario is - users are interested in Exemplars for their latency metric (Histogram), but not so much for other instruments like counters/etc. But all their instruments now pay for the cost of Exemplars.
  2. It is not possible to turn off ExemplarFilter per instrument, as ExemplarFilter is applied at provider level
  3. Users can use Views to change ExemplarReservoir per instrument, however, there is no "no-op" ExemplarReservoir in the spec. This forces users to write one themselves, and then selectively apply that to instruments.

Some thoughts on fixing this:

  1. Not do anything in the spec, and let languages solve it with different defaults (if perf drop is significant, and is a concern for a language)
  2. Change the defaults and make Exemplars opt-in on a instrument-by-instrument basis. So users can selectively enable it for those instruments where they see value.
  3. Introduce No-OpExemplarReservoir part of the spec, and make it the default for non-Histogram instruments, assuming Histograms is where most users are interested in Exemplars, and the fact that perf drop is most significant for non-histograms (.NET example. would love to see if other languages observe similar).
  4. Others/please share!

Metadata

Metadata

Assignees

Labels

spec:metricsRelated to the specification/metrics directorytriage:deciding:community-feedbackOpen to community discussion. If the community can provide sufficient reasoning, it may be accepted

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions