fix: include custom-event meta in beacon summaries (website + mobile analyze) - #125
fix: include custom-event meta in beacon summaries (website + mobile analyze)#125ppolezhaev wants to merge 1 commit into
Conversation
get_website_beacons and get_all_mobile_app_beacons summarize each
beacon through an essential_fields whitelist that omits `meta` — but
for CUSTOM beacons the user-defined meta key/value pairs are the
payload itself (what ineum('reportEvent', name, {meta}) reports, and
what the Instana UI shows in the beacon detail panel). The tag catalog
exposes beacon.meta for filtering and grouping, yet the values were
unreachable in list output.
Add "meta" to both whitelists. The existing empty-value skip already
drops empty meta dicts, so beacons without meta are unchanged and the
summarizer's size-reduction goal is preserved. Adds unit tests for
both modules.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: petrpolezhaev <petr.polezhaev@sixt.com>
|
@ppolezhaev
|
|
Thanks @SLIBM @NiyathaVS for your reviews! @ppolezhaev - There were some comments added to your other 2 PRs: Since all these 3 PRs seems to be in a specific area of Instana, could you please us know if you agree with the assessment done there and we can then finalize all 3 PRs together? |
Problem
get_website_beaconsandget_all_mobile_app_beaconssummarize each beacon through anessential_fieldswhitelist that omitsmeta. ForCUSTOMbeacons, the user-definedmetakey/value pairs are the payload — they're whatineum('reportEvent', name, {meta: {...}})reports, and what the Instana UI shows in the beacon detail panel. The tag catalog also exposesbeacon.meta/mobileBeacon.metafor filtering and grouping, yet the values are unreachable in list output: every custom-event beacon comes back with browser/OS/geo context but without the data the event was created to carry.Repro
ineum('reportEvent', 'my_event', {meta: {flow: 'checkout', step: 'payment'}})get_website_beaconswithbeacon_type: "CUSTOM"filtered to that event.metakey, even though the raw/api/website-monitoring/analyze/beaconsresponse includes it —_summarize_beacons_responsedrops it via the whitelist.Fix
Add
"meta"to the summarizers' field whitelists in both the website and mobile-app analyze modules. The existing empty-value skip logic already removes emptymetadicts, so beacons without meta are byte-identical to before and the summarizer's size-reduction purpose (the ~70-80% cut noted in its docstring) is preserved for non-custom beacon types.Tests
tests/website/test_website_analyze.py: meta survives summarization; empty meta stays omitted.tests/mobile_app/test_mobile_app_analyze.py: meta survives summarization.uv run testpasses (the only failure,TestVersionImport.test_version_fallback_on_exception, is pre-existing onmain— it asserts a hardcoded0.9.6fallback against the current1.0.0).uv run ruff check .passes.🤖 Generated with Claude Code