Skip to main content

C1 — Frontend Telemetry Event Dictionary

Scope: The single sortable list of every frontend-emitted telemetry event for Ghasi Melmastoon across all surfaces (web, mobile, desktop, kiosk, tablet). Each event maps to a journey step, a workflow, and a surface. Analytics, RUM, and observability pipelines consume from this catalog.

Instrumentation: All events are emitted via @ghasi/telemetry (wraps OpenTelemetry + web-vitals). Web events flow to the BFF over POST /telemetry/v1/events (batched, sampled). Mobile uses the same JSON schema over the React Native bridge. Desktop uses the OTel SDK Node binding in the main process. Kiosk mirrors desktop telemetry.

Privacy: No PII in event properties. Guest identity is represented only as gms_id (pseudonymous UUID keyed to the BFF session). Reservation IDs and property IDs are permitted. Payment instrument details are never logged.


1. Schema (all events)

interface MelmastoonTelemetryEvent {
event_name: string; // kebab-case, namespaced: "mel.<surface>.<noun>.<verb>"
event_version: string; // semver e.g. "1.0.0"
timestamp_ms: number; // Unix epoch ms
session_id: string; // BFF-issued session UUID
surface: Surface; // see §2
journey_id?: string; // "J-01" .. "J-22"
workflow_id?: string; // "W-01" .. "W-12"
tenant_id?: string; // present when in-tenant context
property_id?: string;
correlation_id?: string; // traceparent propagated from BFF
user_agent?: string; // stripped to browser family + major version
locale: string; // BCP 47 e.g. "ps-AF"
dir: "ltr" | "rtl";
properties: Record<string, string | number | boolean | null>;
}

type Surface = "consumer-web" | "tenant-booking-web" | "guest-portal-web" |
"control-plane-web" | "ota-portal-web" |
"consumer-mobile" | "staff-mobile" |
"operator-desktop" | "kiosk" | "tablet-pos";

2. Event catalog

2.1 Discovery & Search (J-01, W-01)

#Event nameVersionTriggerKey propertiesSurface(s)
D-01mel.consumer.search.executed1.0.0User submits search (tap/click or URL navigation)query_type (text/map/filter), destination, check_in, check_out, adult_count, room_count, filter_count, result_count, latency_msconsumer-web, consumer-mobile
D-02mel.consumer.search.results_rendered1.0.0Results list/map mounts with dataresult_count, render_mode (list/map), above_fold_count, latency_msconsumer-web, consumer-mobile
D-03mel.consumer.search.filter_applied1.0.0User applies or removes a filter chipfilter_key, filter_value, result_count_afterconsumer-web, consumer-mobile
D-04mel.consumer.search.sort_changed1.0.0User changes sort ordersort_key (price_asc / distance / popularity / rating), result_countconsumer-web, consumer-mobile
D-05mel.consumer.property.card_clicked1.0.0Guest taps a property card in list or mapproperty_id, rank_position, render_mode, min_rate_afnconsumer-web, consumer-mobile
D-06mel.consumer.property.detail_viewed1.0.0Property detail page/screen mountsproperty_id, photo_count, rate_count, latency_msconsumer-web, consumer-mobile
D-07mel.consumer.property.shortlisted1.0.0Guest adds to shortlist/wishlistproperty_id, shortlist_size, storage_type (cookie/account)consumer-web, consumer-mobile
D-08mel.consumer.property.shortlist_removed1.0.0Guest removes from shortlistproperty_id, shortlist_sizeconsumer-web, consumer-mobile
D-09mel.consumer.map.pin_hovered1.0.0Guest hovers/long-presses a map pinproperty_id, rank_positionconsumer-web, consumer-mobile
D-10mel.consumer.search.no_results1.0.0Search returns 0 resultsdestination, check_in, check_out, filter_countconsumer-web, consumer-mobile

2.2 Booking Handoff (J-02, W-02)

#Event nameVersionTriggerKey propertiesSurface(s)
H-01mel.consumer.handoff.initiated1.0.0Guest taps "Book" on property detailproperty_id, tenant_id, source (list/map/detail)consumer-web, consumer-mobile
H-02mel.tenant.bootstrap.completed1.0.0Tenant theme + policy bootstrap resolvestenant_id, theme_version, latency_ms, localetenant-booking-web, consumer-mobile
H-03mel.tenant.bootstrap.failed1.0.0Bootstrap errortenant_id, error_code, retry_counttenant-booking-web, consumer-mobile

2.3 Booking Funnel (J-03, J-04, W-03, W-04)

#Event nameVersionTriggerKey propertiesSurface(s)
B-01mel.booking.funnel.step_viewed1.0.0Funnel step screen mountsstep (room_select/rate_select/guest_details/payment/confirm), tenant_id, property_idtenant-booking-web, consumer-mobile
B-02mel.booking.funnel.step_completed1.0.0User advances to next stepstep, duration_ms, tenant_idtenant-booking-web, consumer-mobile
B-03mel.booking.funnel.step_abandoned1.0.0User exits mid-funnelstep, duration_ms, tenant_idtenant-booking-web, consumer-mobile
B-04mel.booking.room.selected1.0.0Guest selects a room typeproperty_id, room_type_id, rate_plan_id, nights, rate_afntenant-booking-web, consumer-mobile
B-05mel.booking.rate.selected1.0.0Guest selects a rate planrate_plan_id, rate_plan_type, total_afn, cancellation_policytenant-booking-web, consumer-mobile
B-06mel.booking.payment_method.selected1.0.0Guest selects payment methodmethod (cash_on_arrival/card/mobile_money), tenant_idtenant-booking-web, consumer-mobile
B-07mel.booking.payment.3ds_started1.0.03DS challenge iframe mountstenant_id, amount_afn, currencytenant-booking-web, consumer-mobile
B-08mel.booking.payment.3ds_completed1.0.03DS challenge resolvestenant_id, outcome (success/fail/timeout)tenant-booking-web, consumer-mobile
B-09mel.booking.confirmation.shown1.0.0Confirmation screen mountsreservation_id, tenant_id, payment_method, total_afn, nightstenant-booking-web, consumer-mobile
B-10mel.booking.confirmation.receipt_downloaded1.0.0Guest downloads receipt PDFreservation_id, tenant_idtenant-booking-web, consumer-mobile
B-11mel.booking.error.payment_failed1.0.0Payment error shownerror_code, tenant_id, methodtenant-booking-web, consumer-mobile
B-12mel.booking.error.availability_changed1.0.0Room no longer available after holdtenant_id, property_id, room_type_idtenant-booking-web, consumer-mobile
B-13mel.booking.hold.acquired1.0.0BFF issues holdhold_id, expires_at, tenant_idtenant-booking-web, consumer-mobile
B-14mel.booking.hold.expired1.0.0Hold timer reaches 0 before confirmhold_id, tenant_id, steptenant-booking-web, consumer-mobile

2.4 Front Desk / Backoffice (J-05 to J-12, W-05 to W-10)

#Event nameVersionTriggerKey propertiesSurface(s)
FD-01mel.desk.checkin.initiated1.0.0Clerk opens check-in modalreservation_id, tenant_id, source (arrivals_board/search)operator-desktop
FD-02mel.desk.checkin.completed1.0.0Reservation moves to checked_inreservation_id, duration_ms, payment_methodoperator-desktop
FD-03mel.desk.key.issued1.0.0Key credential issuedreservation_id, key_type (mobile/pin/card), vendoroperator-desktop, kiosk
FD-04mel.desk.key.issue_failed1.0.0Key issuance failedreservation_id, key_type, vendor, error_codeoperator-desktop, kiosk
FD-05mel.desk.checkout.completed1.0.0Reservation moves to checked_outreservation_id, folio_total_afn, settlement_method, duration_msoperator-desktop
FD-06mel.desk.walkin.booking_created1.0.0Walk-in booking saved (online or offline)reservation_id, offline (bool), payment_method, rooms, nightsoperator-desktop
FD-07mel.desk.room_move.completed1.0.0Room reassignment savedreservation_id, old_room_id, new_room_idoperator-desktop
FD-08mel.desk.folio.charge_added1.0.0Charge posted to folioreservation_id, charge_type, amount_afnoperator-desktop
FD-09mel.desk.folio.refund_issued1.0.0Refund approved and appliedreservation_id, amount_afn, approval_roleoperator-desktop
FD-10mel.desk.eod.drawer_closed1.0.0EOD cash drawer close submittedtenant_id, expected_afn, actual_afn, variance_afn, shift_idoperator-desktop
FD-11mel.desk.eod.report_exported1.0.0EOD report PDF exportedtenant_id, report_type, shift_idoperator-desktop
FD-12mel.desk.registration.submitted1.0.0Daily guest registration submitted to authoritytenant_id, guest_count, date, authority_endpointoperator-desktop
FD-13mel.desk.sync.pull_completed1.0.0Sync pull round-trip completestenant_id, records_received, latency_ms, conflict_countoperator-desktop
FD-14mel.desk.sync.conflict_resolved1.0.0User resolves a sync conflictaggregate_type, strategy (keep_local/keep_remote/manual), tenant_idoperator-desktop
FD-15mel.desk.offline.mode_entered1.0.0App detects network losstenant_id, last_sync_atoperator-desktop
FD-16mel.desk.offline.mode_exited1.0.0App reconnects and triggers synctenant_id, offline_duration_ms, outbox_queue_sizeoperator-desktop

2.5 Housekeeping (J-19 to J-22, W-08)

#Event nameVersionTriggerKey propertiesSurface(s)
HK-01mel.hk.task.viewed1.0.0Housekeeper views task detailtask_id, room_id, tenant_idoperator-desktop, kiosk, staff-mobile
HK-02mel.hk.task.status_updated1.0.0Room status changed (dirty→cleaning→clean)task_id, room_id, old_status, new_status, offlineoperator-desktop, kiosk, staff-mobile
HK-03mel.hk.task.maintenance_escalated1.0.0Housekeeper raises maintenance tickettask_id, room_id, issue_type, photo_attachedoperator-desktop, kiosk, staff-mobile
HK-04mel.hk.board.reordered1.0.0Lead manually re-orders board (overriding AI suggestion)tenant_id, moved_task_id, ai_overrideoperator-desktop
HK-05mel.hk.ai_suggestion.accepted1.0.0Lead accepts AI-suggested task ordertenant_id, suggestion_id, tasks_affectedoperator-desktop
HK-06mel.hk.ai_suggestion.rejected1.0.0Lead rejects or ignores AI suggestiontenant_id, suggestion_id, reason_codeoperator-desktop

2.6 Management & AI (J-13 to J-18, W-09, W-11)

#Event nameVersionTriggerKey propertiesSurface(s)
MG-01mel.mgmt.pricing.ai_suggestion_shown1.0.0AI pricing suggestion surfaces in GM viewsuggestion_id, room_type_id, suggested_rate_afn, delta_pct, model, localoperator-desktop
MG-02mel.mgmt.pricing.ai_suggestion_accepted1.0.0GM accepts suggestionsuggestion_id, room_type_id, review_msoperator-desktop
MG-03mel.mgmt.pricing.ai_suggestion_rejected1.0.0GM rejects suggestionsuggestion_id, reason_codeoperator-desktop
MG-04mel.mgmt.dashboard.kpi_viewed1.0.0Daily ops dashboard mountstenant_id, date, occupancy_pct, adr_afn, arrivals_countoperator-desktop
MG-05mel.mgmt.report.tax_exported1.0.0Monthly tax report exportedtenant_id, period, format (pdf/csv)operator-desktop
MG-06mel.mgmt.tenant.onboarding_step_completed1.0.0Super-admin completes an onboarding steptenant_id, step, duration_mscontrol-plane-web
MG-07mel.mgmt.theme.preview_opened1.0.0Theme preview opened in control planetenant_id, theme_version_draftcontrol-plane-web
MG-08mel.mgmt.theme.published1.0.0Theme publish submittedtenant_id, theme_versioncontrol-plane-web
MG-09mel.mgmt.theme.rolled_back1.0.0Theme rolled back to previous versiontenant_id, rolled_back_to_versioncontrol-plane-web

2.7 AI provenance events (cross-surface)

#Event nameVersionTriggerKey propertiesSurface(s)
AI-01mel.ai.suggestion.rendered1.0.0Any AI suggestion component mountssuggestion_id, model, version, prompt_id, local (bool), surfaceall
AI-02mel.ai.suggestion.accepted1.0.0Human accepts suggestionsuggestion_id, review_msall
AI-03mel.ai.suggestion.rejected1.0.0Human rejects suggestionsuggestion_id, reason_codeall
AI-04mel.ai.suggestion.timeout1.0.0Suggestion timeout (model too slow)suggestion_id, waited_ms, fallbackall
AI-05mel.ai.inference.local_completed1.0.0ONNX local inference completesmodel, version, latency_ms, first_token_msoperator-desktop
AI-06mel.ai.inference.cloud_completed1.0.0Cloud AI inference completesmodel, version, latency_ms, tokens_in, tokens_outall

2.8 Core Web Vitals + performance (web + mobile)

#Event nameVersionTriggerKey propertiesSurface(s)
P-01mel.web.vitals.lcp1.0.0web-vitals LCP callbackvalue_ms, rating (good/needs-improvement/poor), route, tenant_idconsumer-web, tenant-booking-web
P-02mel.web.vitals.inp1.0.0web-vitals INP callbackvalue_ms, rating, route, tenant_idconsumer-web, tenant-booking-web
P-03mel.web.vitals.cls1.0.0web-vitals CLS callbackvalue, rating, routeconsumer-web, tenant-booking-web
P-04mel.web.vitals.ttfb1.0.0web-vitals TTFB callbackvalue_ms, rating, routeconsumer-web, tenant-booking-web
P-05mel.mobile.startup.cold1.0.0React Native app reaches interactiveduration_ms, locale, surfaceconsumer-mobile, staff-mobile
P-06mel.desktop.startup.cold1.0.0Electron reaches first paintduration_ms, tenant_idoperator-desktop

3. Sampling policy

TierDefault sample rateOverride
Core Web Vitals100%
Booking funnel steps100%
AI suggestion events100%
Search executed (authenticated)100%
Search executed (anonymous)1%Feature flag TELEMETRY_SEARCH_ANON_RATE
Map pin hover, card scroll10%Feature flag TELEMETRY_INTERACTION_RATE
HK task views100% (staff)
Desktop sync events100%

4. Retention

Event groupRetention
Booking funnel, confirmation, payment365 days (compliance)
AI suggestion events180 days
Core Web Vitals90 days
Search, map, interaction30 days
Desktop sync, offline events90 days

5. Open Questions

  • Should mel.consumer.search.executed include raw query text (filtered for PII) for ML training, or only structured fields?
  • Should we add a mel.booking.funnel.funnel_id property to correlate abandoned + resumed sessions across page reloads?
  • Desktop sync events: should latency_ms include the outbox flush time or only the network round-trip?

References