发布

  • [OPIK-6849] [BE] feat: support last_updated_at / created_at filters on Span search (#7018)

    frostbyte_neo 发布于 2026-06-11 11:14:54 +00:00

    • [OPIK-6849] [BE] feat: support last_updated_at / created_at filters on Span search

    SpanField was missing CREATED_AT and LAST_UPDATED_AT, so span search
    (POST /v1/private/spans/search) rejected those date-time filters at request
    deserialization with HTTP 400. Add both enum values, map them to their DB
    columns and add them to the FilterStrategy.SPAN allow-set, mirroring the
    existing trace support. No ClickHouse migration is required for the columns
    (spans already has created_at / last_updated_at).

    Also add minmax skip indexes on created_at / last_updated_at for spans and
    traces (added and materialized) so range filters on these columns prune
    granules instead of scanning the whole project partition.

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

    • [OPIK-6849] address PR review comments
    • Migration ends with a trailing empty line (per opik-backend migrations guideline)
    • Use getFirst() / getLast() instead of index access in the last_updated_at window test

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

    • [OPIK-6849] handle created_at / last_updated_at in span online-scoring evaluator

    Now that SpanField accepts CREATED_AT / LAST_UPDATED_AT, the in-memory
    online-scoring evaluator must extract them too, otherwise span automation-rule
    filters on these fields would be silently ignored at scoring time. Mirrors the
    trace evaluator handling added in #6366. Adds unit coverage.

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com


    Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com

    下载附件