-
[OPIK-7308] [BE] Sentinel translation + NaN-aware aggregates for spans (end_time / duration / ttft) (#7505)
发布于
2026-07-17 14:35:12 +00:00 - [OPIK-7308] [BE] Sentinel translation + NaN-aware aggregates for spans (end_time / duration / ttft)
Activate the trace sentinel/NaN-aware aggregate framework (OPIK-6892, #7307)
for the spans end_time/duration/ttft columns under a new spanColumnsNonNullable
flag (default off). All wiring is a provable no-op while the columns are still
Nullable; the flag flips in lockstep with the Slice 3 cutover EXCHANGE.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7308] [BE] review: static Set for end_time sentinel fields; avgIf for span duration
- Replace the end_time OR-chain in getAnalyticsDbField with a static
END_TIME_SENTINEL_FIELDS Set membership check. - Use avgIf(duration, NOT isNaN(duration)) for the span average duration,
matching the ticket's If(NOT isNaN(x)) convention directly.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7308] [BE] review: thread spanColumnsNonNullable through metrics-DAO span filters
KpiCardDAO.addSpanFilters and ProjectMetricsDAO span-time metrics built the
SPAN filter with the 2-arg toAnalyticsDbFilters overload (columnsNonNullable
defaulting false), so post-cutover SpanField.END_TIME would resolve to
nullIf(end_time, epoch) on /spans but stay raw end_time on the metrics/KPI
endpoints — an absent span could match one surface but not the other. Thread
spanColumnsNonNullable() through both, mirroring the trace-flag wiring already
present in these DAOs.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7308] [BE] review: thread spanColumnsNonNullable through WorkspaceMetricsDAO span filters
WorkspaceMetricsDAOImpl.getSpanMetric builds its span filters via the
SPAN_FILTER_TEMPLATE_PLACEHOLDERS loop, which called the 2-arg
toAnalyticsDbFilters overload (columnsNonNullable defaulting false). Post-cutover
SpanField.END_TIME would stay raw end_time on the workspace span-metrics endpoint
while /spans and the project metrics/KPI endpoints use nullIf(end_time, epoch),
letting absent spans leak. Inject OpikConfiguration and pass
spanColumnsNonNullable() for the FilterStrategy.SPAN entry (the feedback-score
strategies have no end_time field, so they stay on the flagless path).Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
下载附件