Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f70d4210
Commit
f70d4210
authored
Jan 25, 2021
by
David Kim
Committed by
Stan Hu
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure diff patch size limit is monitorable
parent
c94bbc2b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
0 deletions
+15
-0
changelogs/unreleased/31064-ensure-diff-patch-size-limit-is-monitorable.yml
...sed/31064-ensure-diff-patch-size-limit-is-monitorable.yml
+5
-0
doc/administration/monitoring/prometheus/gitlab_metrics.md
doc/administration/monitoring/prometheus/gitlab_metrics.md
+1
-0
lib/gitlab/git/diff.rb
lib/gitlab/git/diff.rb
+2
-0
spec/lib/gitlab/git/diff_spec.rb
spec/lib/gitlab/git/diff_spec.rb
+7
-0
No files found.
changelogs/unreleased/31064-ensure-diff-patch-size-limit-is-monitorable.yml
0 → 100644
View file @
f70d4210
---
title
:
Add `patch_hard_limit_bytes_hit` metric for monitoring diff patch size limit hits
merge_request
:
52456
author
:
type
:
added
doc/administration/monitoring/prometheus/gitlab_metrics.md
View file @
f70d4210
...
...
@@ -71,6 +71,7 @@ The following metrics are available:
|
`gitlab_transaction_event_etag_caching_resource_changed_total`
| Counter | 9.4 | Counter for ETag cache miss - resource changed |
`endpoint`
|
|
`gitlab_transaction_event_fork_repository_total`
| Counter | 9.4 | Counter for repository forks (RepositoryForkWorker). Only incremented when source repository exists | |
|
`gitlab_transaction_event_import_repository_total`
| Counter | 9.4 | Counter for repository imports (RepositoryImportWorker) | |
|
`gitlab_transaction_event_patch_hard_limit_bytes_hit_total`
| Counter | 13.9 | Counter for diff patch size limit hits | |
|
`gitlab_transaction_event_push_branch_total`
| Counter | 9.4 | Counter for all branch pushes | |
|
`gitlab_transaction_event_push_commit_total`
| Counter | 9.4 | Counter for commits |
`branch`
|
|
`gitlab_transaction_event_push_tag_total`
| Counter | 9.4 | Counter for tag pushes | |
...
...
lib/gitlab/git/diff.rb
View file @
f70d4210
...
...
@@ -244,6 +244,8 @@ module Gitlab
def
prune_diff_if_eligible
if
too_large?
::
Gitlab
::
Metrics
.
add_event
(
:patch_hard_limit_bytes_hit
)
too_large!
elsif
collapsed?
collapse!
...
...
spec/lib/gitlab/git/diff_spec.rb
View file @
f70d4210
...
...
@@ -100,6 +100,13 @@ EOT
expect
(
diff
.
diff
).
to
be_empty
expect
(
diff
).
to
be_too_large
end
it
'logs the event'
do
expect
(
Gitlab
::
Metrics
).
to
receive
(
:add_event
)
.
with
(
:patch_hard_limit_bytes_hit
)
diff
end
end
context
'using a collapsable diff that is too large'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment