Skip to content

2.2.100-7038

@thiagohora thiagohora tagged this 14 Oct 07:30
* [OPIK-8706] [BE] Register span weeks from span writes

SpanWeeksListener writes each written span's weekly partition into span_weeks: on SpansCreated, the
batch's distinct (project, trace, week); on the new SpanInsertedByUpdate event, the span an update wrote
before its create (SpansUpdated carries no span id or project). Inserts use FORMAT Values, so they go
through async inserts; the ReplacingMergeTree collapses repeats. Runs off the request path and only
logs failures.

WeeklyPartitions.storedPartitionOf gives the partition spans_local_v2 actually stores a span in,
including the epoch week for non-v7 ids and 22991225 for ids at or past 2300; a parity test pins it
against the real table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Clarify the SpanWeeksDAO description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Route span_weeks writes through SpanService and the request context

- Rename SpanInsertedByUpdate to PartialSpanCreated.
- SpanWeeksListener depends on SpanService only; SpanService.registerWeeks computes the weeks and calls the DAO.
- SpanWeeksDAO reads workspace and user from the reactor context instead of parameters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Move SpanWeek out of SpanWeeksDAO

- SpanWeek is its own domain record.
- Rename the test's boundary-id trace to traceWithBoundaryIds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Gate span weeks writes behind spanWeeksWriteEnabled

- databaseAnalyticsDataModel.spanWeeksWriteEnabled (ANALYTICS_DB_DATA_MODEL_SPAN_WEEKS_WRITE_ENABLED), default false.
- SpanService.registerWeeks writes nothing while it is off.
- Wired through config.yml, the Helm chart and docker-compose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] registerWeeks returns Mono<Void>; empty trace ids short-circuit in the service

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Build SpanWeek through its builder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Drop the projects.span_weeks_backfilled mentions from the write toggle docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Address review: test that incomplete spans register nothing, accurate listener doc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Validate SpanWeeksDAO.findByTraceIds arguments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Parameterize the incomplete-span registerWeeks test per missing field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Follow the span_weeks review: skip tombstoned weeks, raise the insert partition limit, PODAM fixtures

- findByTraceIds reads only is_deleted = 0 rows.
- The insert allows up to 400 partitions per block: span_weeks is partitioned by year and ids reach every year from
  1969 to 2299, which an async-insert block could exceed at the default 100.
- RegisterWeeks tests build spans with PODAM and assert no extra DAO calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [OPIK-8706] [BE] Drop the insert partition cap: span_weeks is unpartitioned

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Assets 2
Loading