debian-mirror-gitlab/lib/gitlab/observability.rb

20 lines
596 B
Ruby
Raw Normal View History

2023-01-13 00:05:48 +05:30
# frozen_string_literal: true
module Gitlab
module Observability
module_function
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
2023-03-17 16:20:25 +05:30
def observability_enabled?(user, group)
Gitlab::Observability.observability_url.present? && Ability.allowed?(user, :read_observability, group)
end
2023-01-13 00:05:48 +05:30
end
end