Skip to content

Fixes #37526: Expose the storage key of web analytic event data - #37527

Merged
manerow merged 1 commit into
mainfrom
chore/public-web-analytics-extension
Nov 11, 2026
Merged

manerow merged 1 commit into
mainfrom
chore/public-web-analytics-extension

Conversation

@manerow

@manerow manerow commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37526

Web analytic events are stored in entity_extension_time_series under the extension webAnalyticEvent.webAnalyticEventData, which was a private constant of WebAnalyticEventRepository. 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:

  • Improvement

High-level design:

N/A, small change.

Tests:

Use cases covered

  • Web analytic event data is still written, read and deleted under the same extension.

Unit tests

  • No new test: the change is the visibility of an existing constant, with no new logic. Compilation of the module and its consumers is the check.

Backend integration tests

  • Not applicable (no backend API changes).

Local Java test run: PASSED

  • Commit: 9052935715ea (base origin/main) — uncommitted changes were present
  • Finished: 2026-11-11 08:18 UTC · 1.1 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 2 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (1 class) 1 2 0 0 1.1 passed

Ran WebAnalyticEventResourceTest as a focused regression because the constant is used on the write, read and delete paths: 2 tests, 0 failures. WebAnalyticEventResourceIT was not run locally; it runs in the merge queue.

Manual testing performed

  • Built openmetadata-service with this change and compiled the downstream reader that references the constant against it.

UI screen recording:

Not applicable: backend-only visibility change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill 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.
  • Decision check: no durable decision; the stored value is unchanged.

@manerow
manerow requested a review from a team as a code owner November 11, 2026 08:18
@manerow
manerow requested a review from harshach November 11, 2026 08:18
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

Comment on lines +25 to 26
public static final String WEB_ANALYTICS_EVENT_DATA_EXTENSION =
"webAnalyticEvent.webAnalyticEventData";

@gitar-bot gitar-bot Bot Nov 11, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 🟡 Medium risk 0 closed / 1 findings

Making the storage-extension constant public expands the Java API; downstream readers may couple to the key, making future storage-key changes harder.

Makes the web analytic event data extension constant public so external SQL readers can reference the storage key instead of copying the string. Changes are requested before merge: the now-public key becomes a cross-component contract, and the reasoning behind the indexed read path (unique key (entityFQNHash, extension, timestamp)) is not recorded in docs/decisions/. A decision record should document the storage key, its keying, and the migration/notice requirement for changes.

⚠️ Quality: Storage key becomes a cross-component contract with no decision record

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/WebAnalyticEventRepository.java:25-26

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.
🤖 Prompt for agents
Code Review: Makes the web analytic event data extension constant public so external SQL readers can reference the storage key instead of copying the string. Changes are requested before merge: the now-public key becomes a cross-component contract, and the reasoning behind the indexed read path (unique key `(entityFQNHash, extension, timestamp)`) is not recorded in `docs/decisions/`. A decision record should document the storage key, its keying, and the migration/notice requirement for changes.

1. ⚠️ Quality: Storage key becomes a cross-component contract with no decision record
   Files: openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/WebAnalyticEventRepository.java:25-26

   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."

   Fix (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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow manerow added the To release Will cherry-pick this PR into the release branch label Nov 11, 2026
@manerow
manerow merged commit 73b1294 into main Nov 11, 2026
63 of 65 checks passed
@manerow
manerow deleted the chore/public-web-analytics-extension branch November 11, 2026 08:55
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.0 opened as #37534 (clean cherry-pick). It merges itself once the checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the storage key of web analytic event data

2 participants