feat: bound a flood of beacon events in the rollup - #109
Merged
Conversation
The collection path is unauthenticated and idempotent by design, so anybody can send its URL a million times and have every one of them counted under a page value naming a page nobody opened. Stopping that at the edge takes a request counter, and the only place at the edge that holds one is AWS WAF at $6.00 a month before a request reaches it. So the judgement goes in the query, beside the crawler filter every question already applies. A `beaconEvents` rollup counts what the beacon reported, by page and by event name, and counts one visitor's identical events no more than 60 times an hour. That is one a minute from one person, on one page, of one event name. A reader moving around a site is capped on each page separately, and a client sending the same URL a million times contributes 60. #104 lists the two candidates that lost. Dropping events whose page never appears as a pageview drops exactly the single-page route changes layer 2 exists to collect. A cap per path has no number that both bounds a flood and spares a popular page. The cap is keyed on the hour of the row's own timestamp rather than on the window being computed. One query text serves both cadences, so an hourly and a daily summary apply the same cap and the 24 hours of a day add up to it. A visitor here is the address and user agent CloudFront logged, being the pair a visitor count is hashed from, and neither value leaves the query. A deployment delivering no address is refused at synthesis through the new `identifiesViewers` flag on `Rollup`, since a beacon rollup without the cap would report a flood of a million as a million. The question is opt-in rather than a sixth default. A site with no beacon would otherwise pay 50 Athena queries a day for an empty answer, about 8 cents a month against the $0.084 #9 measured for the whole log store. A site running the beacon passes it to `RollupQueries` and `RollupSummaries` and reads it with `rainlytics saved-query beacon-events`. The cases run the SQL through Yulin's query engine over delivered objects rather than asserting on its text. Yulin has no `least`, raised as KensioSoftware/yulin#1141, so the cap is written as the `CASE` that says the same thing and both engines run.
|
Warning Review limit reachedNext included review available in 8 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 (10)
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's collection path is unauthenticated and idempotent by design, so anybody can send its URL a million times and have every one of them counted under a page value naming a page nobody opened. Stopping that at the edge takes a request counter and the only place at the edge that holds one is AWS WAF, at $6.00 a month before a request reaches it, so the judgement goes in the query instead, beside the crawler filter every question already applies. A
beaconEventsrollup counts what the beacon reported by page and by event name, and counts one visitor's identical events no more than 60 times an hour, which is one a minute from one person on one page of one event name. The cap is keyed on the hour of the row's own timestamp rather than on the window being computed, so an hourly and a daily summary apply the same cap and the 24 hours of a day add up to it. A visitor here is the address and user agent CloudFront logged, being the pair a visitor count is hashed from, and neither value leaves the query, so a deployment delivering no address is refused at synthesis through a newidentifiesViewersflag onRollup. The question is opt-in rather than a sixth default question, because a site with no beacon would otherwise pay 50 Athena queries a day for an empty answer, about 8 cents a month against the $0.084 #9 measured for the whole log store, andrainlytics saved-query beacon-eventsis the command that already exists for a question deployed from somewhere else. The cases run the SQL through Yulin's query engine over delivered log objects rather than asserting on its text, and Yulin has noleast(raised as KensioSoftware/yulin#1141), so the cap is written as theCASEthat says the same thing and both engines run.Resolves #104
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/See https://www.conventionalcommits.org/en/v1.0.0/