histograms

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package histograms holds the opinionated default aggregation used across the ethPandaOps agent SDKs. We default to base-2 exponential histograms so that latency and magnitude histograms have good resolution without manual bucket picking.

MaxScale=3 caps the growth factor at 2^(1/8) ≈ 1.0905 per bucket — roughly equivalent to the Prometheus native-histogram default of 1.1. MaxSize=160 caps per-series memory; the SDK downscales if the range would exceed that.

Index

Constants

View Source
const (
	DefaultMaxSize  = 160
	DefaultMaxScale = 3
)

Variables

This section is empty.

Functions

func AggregationSelector

func AggregationSelector(kind sdkmetric.InstrumentKind) sdkmetric.Aggregation

AggregationSelector returns ExponentialHistogram for Histogram instruments and falls back to the OTel defaults for other instrument kinds. Plug into the Prometheus exporter via otelprom.WithAggregationSelector.

func ExponentialHistogram

func ExponentialHistogram() sdkmetric.Aggregation

ExponentialHistogram returns the opinionated default aggregation for latency- and magnitude-style histograms.

func NewAggregation

func NewAggregation(maxSize, maxScale int32) sdkmetric.Aggregation

NewAggregation returns a base-2 exponential histogram aggregation with the given MaxSize and MaxScale. Use when the package defaults (MaxSize=160, MaxScale=3) are a poor fit for a specific deployment; prefer ExponentialHistogram otherwise.

func NewSelector

NewSelector returns an AggregationSelector that applies the given aggregation to histogram instruments and falls back to OTel defaults for other kinds. Pair with NewAggregation to plug custom tuning into promexporter via WithAggregationSelector.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL