Filter `license_scanning_jobs` out of Service Ping payload
Summary
With !72083 (merged) license_scanning_jobs
and license_management_jobs
metrics were refactored to use instrumentation class. During refactor removing license_scanning_jobs
out of payload was left in responsibility of ServicePing::BuildPayloadService
. However payload filtering based on metric definition is only executed when there is active license present for EE instance (see https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/services/ee/service_ping/build_payload_service.rb#L10) as a result EE self managed instance started to report both license_scanning_jobs
and license_management_jobs
instead of only license_management_jobs
Steps to reproduce
#in rails console
# 1 stub License.current method
class License
def self.current
nil
end
end
# 2 collect payload
payload = ServicePing::BuildPayloadService.new.execute
# 3 check that unwanted key is present
payload[:counts].key? :license_scanning_jobs
Example Project
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)