blob: d42d10cd0f4d5094951a5cf6f844b9b1d5940cd2 (
plain)
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
|
# frozen_string_literal: true
module Gitlab
module Observability
extend self
# Returns the GitLab Observability URL
#
def observability_url
return ENV['OVERRIDE_OBSERVABILITY_URL'] if ENV['OVERRIDE_OBSERVABILITY_URL']
# TODO Make observability URL configurable https://gitlab.com/gitlab-org/opstrace/opstrace-ui/-/issues/80
return 'https://observe.staging.gitlab.com' if Gitlab.staging?
'https://observe.gitlab.com'
end
def oauth_url
"#{Gitlab::Observability.observability_url}/v1/auth/start"
end
def provisioning_url(project)
"#{Gitlab::Observability.observability_url}/v3/tenant/#{project.id}"
end
def should_enable_observability_auth_scopes?(resource)
# Enable the needed oauth scopes if tracing is enabled.
if resource.is_a?(Group) || resource.is_a?(Project)
return Feature.enabled?(:observability_tracing,
resource.root_ancestor)
end
false
end
end
end
Gitlab::Observability.prepend_mod_with('Gitlab::Observability')
|