File: flow_advisor.rb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (65 lines) | stat: -rwxr-xr-x 3,030 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# frozen_string_literal: true

# Blocks of text rendered in CLI
module InternalEventsCli
  module Text
    module FlowAdvisor
      extend Helpers

      ALTERNATE_RESOURCES_NOTICE = <<~TEXT.freeze
        Other resources:

        #{format_warning('Tracking GitLab feature usage from database info:')}
            https://docs.gitlab.com/ee/development/internal_analytics/metrics/metrics_instrumentation.html#database-metrics

        #{format_warning('Migrating existing metrics to use Internal Events:')}
            https://docs.gitlab.com/ee/development/internal_analytics/internal_event_instrumentation/migration.html

        #{format_warning('Remove an existing metric:')}
            https://docs.gitlab.com/ee/development/internal_analytics/metrics/metrics_lifecycle.html

        #{format_warning('Finding existing usage data for GitLab features:')}
            https://metrics.gitlab.com/ (Customize Table > Snowflake query)
            https://10az.online.tableau.com/#/site/gitlab/views/SnowplowEventExplorationLast30Days/SnowplowEventExplorationLast30D
            https://10az.online.tableau.com/#/site/gitlab/views/PDServicePingExplorationDashboard/MetricsExploration

        #{format_warning('Customer wants usage data for their own GitLab instance:')}
            https://docs.gitlab.com/ee/user/analytics/

        #{format_warning('Customer wants usage data for their own products:')}
            https://docs.gitlab.com/ee/operations/product_analytics/
      TEXT

      EVENT_TRACKING_EXAMPLES = <<~TEXT
        Product usage can be tracked in several ways.

        By tracking events:     ex) a user changes the assignee on an issue
                                ex) a user uploads a CI template
                                ex) a service desk request is received
                                ex) all stale runners are cleaned up
                                ex) a user copies code to the clipboard from markdown
                                ex) a user uploads an issue template OR a user uploads an MR template

        From database data:     ex) track whether each gitlab instance allows signups
                                ex) query how many projects are on each gitlab instance

      TEXT

      EVENT_EXISTENCE_CHECK_INSTRUCTIONS = <<~TEXT.freeze
        To determine what to do next, let's figure out if the event is already tracked & usable.

        If you're unsure whether an event exists, you can check the existing defintions.

          #{format_info('FROM GDK')}: Check `config/events/` or `ee/config/events`
          #{format_info('FROM BROWSER')}: Check https://metrics.gitlab.com/snowplow

          Find one? Create a new metric for the event.
          Otherwise? Create a new event.

        If you find a relevant event that does not have the property `internal_events: true`, it can be migrated to
        Internal Events. See https://docs.gitlab.com/ee/development/internal_analytics/internal_event_instrumentation/migration.html

      TEXT
    end
  end
end