← Back to Dashboard
Verified Production Fix

[gitlab-org/gitlab] Implement offline transfer export observability

GL-gitlab-org/gitlab#592635 • Mar 07, 2026

### ROOT CAUSE The issue is about enhancing GitLab's offline transfer exports by adding observability to track usage and surface this data in Tableau. Currently, there's no mechanism to log internal events for offline transfers, making it impossible to analyze usage patterns. Implementing event tracking and integration with Tableau will provide the necessary insights. ### CODE FIX To address this issue, we'll create an event tracking module and integrate it into the relevant parts of the codebase. Here's how to proceed: 1. **Create an Event Tracking Module:** - **File:** `lib/analytics/offline_transfer_event.rb`
ruby
   module OfflineTransferEvent
     extend ActiveSupport::Concern

     class << self
       def log(event_type, attributes = {})
         Gitlab::Analytics::Tracker.track(
           'offline_transfer_export',
           event_type,
           attributes
         )
       end
     end
   end
   


2. **Track Events in the Export Process:**
   - **File:** `app/models/export.rb` (or relevant model/controller)
   
ruby
   class Export
     include OfflineTransferEvent

     def export_data
       # Existing export logic
       # ...

       # Log the start of the export
       self.class.log('export_started', {
         user_id: user.id,
         project_id: project.id,
         timestamp: Time.current
       })

       # After export completes
       self.class.log('export_completed', {
         user_id: user.id,
         project_id: project.id,
         timestamp: Time.current,
         success: true
       })
     end
   end
   


3. **Set Up Tableau Integration:**
   - **File:** `db/views/offline_transfer.exports_view.sql`
   
sql
   CREATE MATERIALIZED VIEW IF NOT EXISTS offline_transfer.exports AS (
     SELECT 
       events.*,
       users.name,
       projects.name as project_name,
       created_at as timestamp
     FROM 
       events
     JOIN 
       users ON events.user_id = users.id
     JOIN 
       projects ON events.project_id = projects.id
     WHERE 
       event_type IN ('export_started', 'export_completed')
   );
   


4. **Update Database Indexes:**
   - **File:** `db/migrate/[timestamp]_add_indexes_to_events.rb`
   
ruby
   class AddIndexesToEvents < ActiveRecord::Migration[6.0]
     def change
       add_index :events, :event_type
       add_index :events, :created_at
       add_index :events, :user_id
       add_index :events, :project_id
     end
   end
   


5. **Update Documentation:**
   - Add documentation explaining the new event tracking and how to access the data in Tableau.

This solution introduces event tracking for offline transfer exports, logs necessary events, and integrates with Tableau for data visualization, providing the required observability.

Deploy with Vultr

Use this fix in production instantly. Claim your high-performance developer credit.

Get Started with Vultr →