Skip to content

Embed phase 2: count embed calls at the edge with Analytics Engine #412

Closed

Description

@neuromechanist

Part of #410, which is the plan of record. Scope, files, and decision gates: the "Phase 2" sections of #410. Starts after phase 1 merges (both change src/middleware.ts).

Activity

  1. neuromechanist commented on Oct 5, 2026

    @neuromechanist
    ContributorAuthor

    Merged to staging in #417 as ce5bbea. Kept open until the rows are read back through the observability dashboard (nemarOrg/nemar-observability#97) and the post-release production smoke check in ADR 0024 passes.

  2. neuromechanist commented on Oct 5, 2026

    @neuromechanist
    ContributorAuthor

    Gate 2 (rows in nemar_website_embeds_dev) passes. The owner ran it with a new Account Analytics Read token, which is now also on nemar-observability-dev. The query covered the last 24 hours of 2026-10-05, SUM(_sample_interval) grouped by dataset, host and kind:

    Dataset Host Kind Calls
    on007753 localhost iframe 260
    xx099901 127.0.0.1 iframe 28
    xx099901 (none) document 18
    on007753 127.0.0.1 iframe 6
    on007753 (none) iframe 4
    xx099901 (none) none 3
    on007753 probe.example iframe 2
    on007753 repeat.example iframe 2
    on007753 (none) none 2
    nm000292 miss-then-hit.example iframe 2
    on007753 example.org iframe 1
    on007753 final-head.invalid iframe 1
    on007753 after-review.invalid iframe 1
    on007753 example.org none 1
    on007753 (none) document 1

    Against the #417 gate 2 table:

    • Every expected row is present: localhost/iframe, example.org/iframe, example.org/none (Referer only), empty host/document, empty host/none ×2 (cache MISS, then HIT), repeat.example ×2, nm000292/miss-then-hit.example ×2, and after-review.invalid.
    • No must-not-count host appears anywhere in the 24 hours: head-must-not-count.example (HEAD), and prefetch-must-not-count.example and purpose-must-not-count.example (prefetch).
    • final-head.invalid (1): one framed GET was sent with that Referer to each of the embed, the dataset page and the home page on Count embed calls at the edge (phase 2 of #410) #417's final preview. Only the embed counted.
    • Staging writes to the dev dataset. The xx099901 rows are test.nemar.org traffic: the cross-site Firefox and Chromium check page on 127.0.0.1:8080 (iframe), the direct-load width sweeps for Embed: two-row toolbar in narrow frames #420 (document) and curl checks (none).
    • Empty host with iframe (4) is the case of a no-referrer parent with no referrerpolicy attribute on the iframe, as Count embed calls at the edge (phase 2 of #410) #417 recorded.

    This issue stays open for the production smoke check after the release: one load with Sec-Fetch-Dest: iframe and Referer: https://smoke.invalid/, then query nemar_website_embeds for blob2 = 'smoke.invalid'.

  3. neuromechanist commented on Oct 5, 2026

    @neuromechanist
    ContributorAuthor

    Production smoke check passes on 0.2.28 (51160dad, released 2026-10-05 as #424). One request to https://nemar.org/dataset/on007753/embed with Sec-Fetch-Dest: iframe and Referer: https://smoke.invalid/ was sent at 17:09:32 UTC and answered 200. Querying nemar_website_embeds for blob2 = 'smoke.invalid' returns exactly one row: on007753 smoke.invalid iframe 1. So the production EMBED_ANALYTICS binding is live and writes to the production dataset. Gate 2 on staging passed earlier, as recorded above.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions