apache/beam · error · UnsupportedOperationException
This runner does not currently support committed metrics res
Error message
This runner does not currently support committed metrics results. Please use 'attempted' instead.
What it means
MetricResult.getCommitted returns the runner-verified committed metric value. Many runners (especially streaming or testing runners) do not compute committed metrics and store null; in that case getCommitted throws UnsupportedOperationException and callers must use getAttempted().
Source
Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/MetricResult.java:53
})
public abstract class MetricResult<T> {
/** Return the name of the metric. */
public MetricName getName() {
return getKey().metricName();
}
public abstract MetricKey getKey();
/**
* Return the value of this metric across all successfully completed parts of the pipeline.
*
* <p>Not all runners will support committed metrics. If they are not supported, the runner will
* throw an {@link UnsupportedOperationException}.
*/
public T getCommitted() {
T committed = getCommittedOrNull();
if (committed == null) {
throw new UnsupportedOperationException(
"This runner does not currently support committed"
+ " metrics results. Please use 'attempted' instead.");
}
return committed;
}
public boolean hasCommitted() {
return getCommittedOrNull() != null;
}
/** Return the value of this metric across all attempts of executing all parts of the pipeline. */
public abstract @Nullable T getCommittedOrNull();
/** Return the value of this metric across all attempts of executing all parts of the pipeline. */
public abstract T getAttempted();
public <V> MetricResult<V> transform(Function<T, V> fn) {
T committed = getCommittedOrNull();View on GitHub (pinned to 12126d8942)
Solutions
- Use getAttempted() instead when committed metrics are unavailable.
- Guard with a null check: MetricsFilter results where getCommittedOrNull() != null before calling getCommitted().
- Run with a runner that supports committed metrics (e.g. DirectRunner/Dataflow) if committed values are required.
- Treat committed as best-effort: fall back to attempted in reporting code.
Example fix
// before long committed = result.getCommitted(); // after Long committed = result.getCommittedOrNull(); long value = committed != null ? committed : result.getAttempted();
Defensive patterns
Strategy: fallback
Validate before calling
Long committed = result.getCommittedOrNull();
Try / catch
try { v = result.getCommitted(); } catch (UnsupportedOperationException e) { v = result.getAttempted(); } Prevention
- Default to getAttempted() in reporting code
- Know your runner's committed-metrics support before asserting on committed values
- Use getCommittedOrNull() for explicit null handling
When it happens
Trigger: Reading metricResults().committed() on a pipeline run by a runner that doesn't support committed metrics (e.g. a runner whose MonitoringInfo rendering leaves committed null), or in unit tests with non-Direct runners.
Common situations: Test assertions on pipeline metrics against unsupported runners, monitoring dashboards reading committed values on streaming pipelines, and runner migrations where metric semantics differ.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- getMonitoringInfos is not implemented on this MetricsContain
- NoOpMetricsSink was not found on classpath
- Internal error initializing BeamFnDataReadRunner: invalid mo
- Unknown URN %s
- Unable to construct %s counter for PTransform {id=%s, name=%
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/1ff5a02775f9934f.
Report an issue: GitHub.