feat: define where a beacon event lives in the log table - #102
Merged
Conversation
The beacon sends a GET to a path on the site's own domain and puts its payload in the query string, so its rows arrive in the CloudFront access log like any other request. They carry different information all the same, and nothing said where that definition lives. It stays in `cs_uri_query`, read at query time. A column of its own was never available: `LogTable` builds its columns from the fields the delivery was configured with, and CloudFront has no field carrying somebody else's payload. A view or a second table over the same objects meets the same wall, because no SerDe parses a query string. `searches` already reads a search term out of the same column this way. `src/beacon-events.ts` holds the envelope both halves read. Three parameters, one letter each, since the whole query string is written into every row and scanned by every query touching the column. The browser builds it with `beaconQueryString` and a rollup reads it back with `beaconEventColumn` and friends, so one definition covers both directions. Partitions written before the beacon shipped answer no rows rather than nulls, because a beacon row is identified by the path it was sent to. That is the one shape of schema change an immutable store takes without argument. What each event type carries beside the envelope is left to the beacon's own issue. `beaconSchemaVersion` rides on every row so that arriving later costs no reinterpretation of rows already written. Closes #100
|
Warning Review limit reachedNext included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 90 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The beacon sends a GET to a path on the site's own domain and puts its payload in the query string, so its rows arrive in the CloudFront access log like any other request. They carry different information all the same, and nothing said where that definition lives. It stays in
cs_uri_query, read at query time. A column of its own was never available, becauseLogTablebuilds its columns from the fields the delivery was configured with and CloudFront has no field carrying somebody else's payload, and a view or a second table over the same objects meets the same wall since no SerDe parses a query string.searchesalready reads a search term out of the same column this way.src/beacon-events.tsholds the envelope both halves read: three parameters, one letter each, built in the browser withbeaconQueryStringand read back as SQL withbeaconEventColumnand friends, so one definition covers both directions. Partitions written before the beacon shipped answer no rows rather than nulls, because a beacon row is identified by the path it was sent to, which is the one shape of schema change an immutable store takes without argument. What each event type carries beside the envelope is left to the beacon's own issue, andbeaconSchemaVersionrides on every row so that arriving later costs no reinterpretation of rows already written.Resolves #100
Conventional commit message, used as the title
Conventional branch name, like
feat/concise-descriptionFull check with
pnpm run checkpassedRebased off latest main
User-facing behaviour is documented in
docs/