Skip to content

Telemetry: Fix `app_server_type` attribute

The following discussion from !32315 (merged) should be addressed:

  • @qzhaogitlab started a discussion: (+13 comments)

    I don't fully understand yet on which servers and processes this entire flow will actually run. I certainly see it running when on puma or unicorn (i.e. a web node), but do we also send usage pings from sidekiq nodes? If not, then I need to revise this, because the sidekiq query would never fire.

    From the document https://docs.gitlab.com/ee/development/telemetry/usage_ping.html#how-usage-ping-works, it says usage ping runs on Sidekiq node.

    How Usage Ping works

    1. The Usage Ping cron job is set in Sidekiq to run weekly.
    2. When the cron job runs, it calls GitLab::UsageData.to_json.
    3. GitLab::UsageData.to_json cascades down to ~400+ other counter method calls.
    4. The response of all methods calls are merged together into a single JSON payload in GitLab::UsageData.to_json.
    5. The JSON payload is then posted to the Versions application.

We think that the app_server_type field that is submitted as part of usage ping is currently broken, because it relies on the value returned by Runtime. However, since usage data is always submitted via a sidekiq job, this will therefore always be sidekiq, when instead it should carry the value of the app server used by the customer.