Merge branch 'fix/gb/remove-unused-pipelines-prometheus-metric' into 'master'
Remove unsued pipelines-related prometheus metric See merge request gitlab-org/gitlab-ce!17515
This commit is contained in:
commit
c6764bdc2a
1 changed files with 0 additions and 16 deletions
|
@ -17,27 +17,11 @@ module Gitlab
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordInvalid => e
|
rescue ActiveRecord::RecordInvalid => e
|
||||||
error("Failed to persist the pipeline: #{e}")
|
error("Failed to persist the pipeline: #{e}")
|
||||||
ensure
|
|
||||||
if pipeline.builds.where(stage_id: nil).any?
|
|
||||||
invalid_builds_counter.increment(node: hostname)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def break?
|
def break?
|
||||||
!pipeline.persisted?
|
!pipeline.persisted?
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def invalid_builds_counter
|
|
||||||
@counter ||= Gitlab::Metrics
|
|
||||||
.counter(:gitlab_ci_invalid_builds_total,
|
|
||||||
'Invalid builds without stage assigned counter')
|
|
||||||
end
|
|
||||||
|
|
||||||
def hostname
|
|
||||||
@hostname ||= Socket.gethostname
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue