Track offline transfer export failures with internal events

What does this MR do and why?

Adds internal-events observability for failed offline transfer exports, so we can compute a failure rate against the start/completion events — surfaced in Tableau.

Part of #592635 (closed) (3 of 3, by event type). Start merged in !245668 (merged), completion in !247165 (merged).

Event

Fires fail_offline_transfer_export from the Import::Offline::Export state machine on transition to :failed (via run_after_commit, next to the failure email). The transition is the single point that captures every path to :failed — both ProcessService (all relation exports failed) and ExportWorker#perform_failure (Sidekiq retry exhaustion). Identified by user.

Kept OT-specific (not a generic fail_export) for the same reason as the completion event: an OT export is a whole portable tree, a different granularity from Direct Transfer's per-entity exports. A generic per-entity event belongs in the shared relation-export layer as future work.

Metric

data_source: internal_events, in config/metrics/counts_all/, one file with time_frame: [all, 28d]:

  • total failed exports — all-time + 28d (failure rate vs. started/completed)

How to set up and validate locally

bin/rspec spec/models/import/offline/export_spec.rb

MR acceptance checklist

  • Analytics Instrumentation review (~"analytics instrumentation").

Merge request reports

Loading
Loading