﻿# Signed diagnostic histograms: an absent sum is not zero

A practical investigation of signed diagnostic histograms: an absent sum is not zero, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-observe-signed-histogram-optional-sum/
Language: en

## The diagnostic situation

A serving estimator records prediction residuals in a diagnostic histogram. Residuals can be negative when execution finishes sooner than predicted. A generic dashboard expects every histogram to provide sum and count, substitutes zero for an absent sum and reports perfect average prediction. The chart has converted an unsupported aggregate into an apparently meaningful result.

## Why the observation changes meaning

OpenTelemetry histogram aggregation separates counts, optional extrema and sum behavior. The SDK guidance avoids collecting a sum for instruments that record negative measurements, while metric representations can omit fields. A signed residual also differs from ordinary nonnegative request duration. The presence of buckets does not prove that a compatible arithmetic sum survived the entire collection and conversion path.

## Define the instrumentation contract

Define the observed quantity and its sign convention before selecting the instrument. Preserve whether sum is present and meaningful, rather than inferring it from a metric name. If mean residual is required, choose a documented compatible aggregation and verify it independently. Keep absolute error, signed bias and latency separate: they answer different questions even when all use time units.

## A bounded verification procedure

Construct synthetic residuals with negative, positive and balanced cases. Retain the raw values and independently calculate the desired diagnostic statistics. Export through the selected instrument, collector and destination. Inspect field presence as well as values. Include an intentionally absent-sum fixture to ensure the query reports unavailable mean instead of manufacturing zero bias from a fallback.

## Evidence required for acceptance

Acceptance evidence includes instrument kind, sign convention, aggregation configuration, raw fixture and exported field inventory. Compare each displayed statistic with the correct raw calculation. Verify that the count belongs to the same population as the sum when a mean is available. A favorable signed mean can still conceal large opposite errors, so retain the distribution rather than replacing it with one summary.

## Failure cases and limits

This protocol does not imply that all histogram implementations omit sums for signed data or that every signed statistic is invalid. Implementation and conversion semantics matter. It validates the availability and meaning of a requested aggregate. It cannot repair an estimator, prove calibration or infer actual request latency from residuals without the corresponding prediction and observation records.

## Primary references and related reading

A signed histogram can retain a distribution without a usable sum; a mean needs valid sum semantics and matched count. [OpenTelemetry metrics SDK](https://opentelemetry.io/docs/specs/otel/metrics/sdk/); [OpenTelemetry metrics data model](https://opentelemetry.io/docs/specs/otel/metrics/data-model/).

The proposed investigation of signed histogram optional sum is not an executed deployment benchmark. Related reading: [Fleet p95: aggregate histograms rather than precomputed percentiles](/journal/provider-latency-histogram-aggregation/); [Monotonic clocks for inference API latency measurements](/journal/provider-monotonic-latency-measurement/).
