Class: Gitlab::Tracking::Destinations::SnowplowMicro
- Inherits:
-
Snowplow
- Object
- Base
- Snowplow
- Gitlab::Tracking::Destinations::SnowplowMicro
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
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
24
25
26
|
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 24
def enabled?
true
end
|
#hostname ⇒ Object
29
30
31
|
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 29
def hostname
"#{uri.host}:#{uri.port}"
end
|
#options(group) ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 15
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
|
#uri ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'lib/gitlab/tracking/destinations/snowplow_micro.rb', line 33
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
|