Enum Class DurationInstrumentationMode

java.lang.Object
java.lang.Enum<DurationInstrumentationMode>
io.github.teceli.resiliencia.opentelemetry.DurationInstrumentationMode
All Implemented Interfaces:
Serializable, Comparable<DurationInstrumentationMode>, Constable

public enum DurationInstrumentationMode extends Enum<DurationInstrumentationMode>
How OpenTelemetryResilienceMetrics records duration metrics (resilience.timeout.duration, resilience.circuitbreaker.calls).

Unlike Micrometer's percentile histograms, there is no "don't opt in" lever available to resiliencia's own code for the OTel SDK's default histogram aggregation: DoubleExplicitBucketHistogramAggregator synchronizes on every recorded value, unconditionally (see docs/architecture/metrics/metrics.md's "Backend audit" section). This closed, two-value enum keeps the safe default enforced by the API shape itself, rather than a consumer-supplied strategy that could reintroduce the same unbounded risk.

  • Enum Constant Details

    • SAFE

      public static final DurationInstrumentationMode SAFE
      Duration recorded as a lock-free counter pair — a count and a summed duration, both backed by LongSumAggregator/DoubleSumAggregator. Mean is derivable (sum / count) by the backend at query time; no percentile/distribution data; zero per-call pinning risk by construction. Default.
    • DETAILED

      public static final DurationInstrumentationMode DETAILED
      Duration recorded via DoubleHistogram.record(...), yielding full percentile/ distribution data, with the documented per-call synchronized pinning risk from the OTel SDK's default explicit-bucket histogram aggregation. Explicit opt-in only.
  • Method Details

    • values

      public static DurationInstrumentationMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DurationInstrumentationMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null