Repository navigation
Fixes #37526: Expose the storage key of web analytic event data - #37527
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| public static final String WEB_ANALYTICS_EVENT_DATA_EXTENSION = | ||
| "webAnalyticEvent.webAnalyticEventData"; |
There was a problem hiding this comment.
⚠️ Quality: Storage key becomes a cross-component contract with no decision record
Making WEB_ANALYTICS_EVENT_DATA_EXTENSION public is meant to give other code a stable key to read with. The description says it is "so code that reads these events with SQL can reference the key instead of copying the string", and it was checked against "the downstream reader that references the constant". After this change, renaming the key or changing how rows are keyed in entity_extension_time_series also breaks readers outside this repository. That makes it a contract another component has to agree with.
The description also states a rule that exists nowhere in the tree: "A query that filters on the event type hash, this extension and a timestamp range reads only the events of its window", which relies on the unique key (entityFQNHash, extension, timestamp). Nothing in docs/decisions/ mentions web analytic events or entity_extension_time_series. Because the repo squash-merges, this reasoning would be lost. The checklist says "no durable decision; the stored value is unchanged", but the value is exactly what is being promised to outside readers.
The record would say: "Web analytic event data is stored in entity_extension_time_series with entityFQNHash = hash of the event type and extension = WebAnalyticEventRepository.WEB_ANALYTICS_EVENT_DATA_EXTENSION (webAnalyticEvent.webAnalyticEventData). External readers filter on that hash, that extension and a timestamp range so the unique key (entityFQNHash, extension, timestamp) serves the query. The key is not renamed, and the keying is not changed, without a migration and notice to those readers."
Add a decision record in this PR and cite it as ADR:<date>-<slug> beside the constant.:
# docs/decisions/2026-11-11-web-analytic-event-data-is-keyed-by-event-type-and-a-public-extension.md
- **Status:** Accepted
## Decision
- Web analytic event data lives in `entity_extension_time_series` under
`entityFQNHash` = hash(event type) and `extension` =
`WebAnalyticEventRepository.WEB_ANALYTICS_EVENT_DATA_EXTENSION`.
- Readers filter on hash, extension and a timestamp range so the unique key
`(entityFQNHash, extension, timestamp)` serves the query.
- The key and keying change only with a migration and notice to readers.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|
🤖 Backport to |
|
🤖 Backport to |
…) (#37534) (cherry picked from commit 73b1294) Co-authored-by: Adrià Manero <[email protected]>
Describe your changes:
Fixes #37526
Web analytic events are stored in
entity_extension_time_seriesunder the extensionwebAnalyticEvent.webAnalyticEventData, which was a private constant ofWebAnalyticEventRepository. This PR makes that constant public, so code that reads these events with SQL can reference the key instead of copying the string.The key matters to such readers because the table's unique key is
(entityFQNHash, extension, timestamp). A query that filters on the event type hash, this extension and a timestamp range reads only the events of its window. Without the extension, a reader either copies the literal or falls back to a filter the index cannot serve, and scans the whole table.How events are stored and read does not change: the value is the same, only its visibility.
Type of change:
High-level design:
N/A, small change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Local Java test run: PASSED
9052935715ea(baseorigin/main) — uncommitted changes were present--scope full).Ran
WebAnalyticEventResourceTestas a focused regression because the constant is used on the write, read and delete paths: 2 tests, 0 failures.WebAnalyticEventResourceITwas not run locally; it runs in the merge queue.Manual testing performed
openmetadata-servicewith this change and compiled the downstream reader that references the constant against it.UI screen recording:
Not applicable: backend-only visibility change.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Self-review at 2bb9c8e: one-line visibility change of an existing constant, no findings.