Class: Gitlab::Tracking::Destinations::SnowplowMicro

Inherits:
Snowplow
  • Object
show all
Extended by:
Utils::Override
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/tracking/destinations/snowplow_micro.rb

Constant Summary collapse

DEFAULT_URI =
'http://localhost:9090'

Constants inherited from Snowplow

Gitlab::Tracking::Destinations::Snowplow::SNOWPLOW_NAMESPACE

Instance Method Summary collapse

Methods included from Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from Snowplow

#event

Methods inherited from Base

#event

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 22

def enabled?
  true
end

#hostnameObject



27
28
29
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 27

def hostname
  "#{uri.host}:#{uri.port}"
end

#options(group) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 13

def options(group)
  super.update(
    protocol: uri.scheme,
    port: uri.port,
    force_secure_tracker: false
  ).transform_keys! { |key| key.to_s.camelize(:lower).to_sym }
end

#uriObject



31
32
33
34
35
36
37
38
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 31

def uri
  strong_memoize(:snowplow_uri) do
    base = base_uri
    uri = URI(base)
    uri = URI("http://#{base}") unless %w[http https].include?(uri.scheme)
    uri
  end
end