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
6332d6ec
Commit
6332d6ec
authored
Jul 28, 2020
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove per-web-transaction redis metrics
We still have those in logs if we need to see them per transaction.
parent
f5ac701e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
84 deletions
+5
-84
changelogs/unreleased/bvl-remove-redis-metrics-per-web-transaction.yml
...released/bvl-remove-redis-metrics-per-web-transaction.yml
+5
-0
config/initializers/zz_metrics.rb
config/initializers/zz_metrics.rb
+0
-1
doc/administration/monitoring/prometheus/gitlab_metrics.md
doc/administration/monitoring/prometheus/gitlab_metrics.md
+0
-2
lib/gitlab/metrics/redis_rack_middleware.rb
lib/gitlab/metrics/redis_rack_middleware.rb
+0
-36
spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb
spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb
+0
-45
No files found.
changelogs/unreleased/bvl-remove-redis-metrics-per-web-transaction.yml
0 → 100644
View file @
6332d6ec
---
title
:
Remove per-web-transaction redis metrics
merge_request
:
38101
author
:
type
:
other
config/initializers/zz_metrics.rb
View file @
6332d6ec
...
@@ -147,7 +147,6 @@ if Gitlab::Metrics.enabled? && !Rails.env.test? && !(Rails.env.development? && d
...
@@ -147,7 +147,6 @@ if Gitlab::Metrics.enabled? && !Rails.env.test? && !(Rails.env.development? && d
Gitlab
::
Application
.
configure
do
|
config
|
Gitlab
::
Application
.
configure
do
|
config
|
config
.
middleware
.
use
(
Gitlab
::
Metrics
::
RackMiddleware
)
config
.
middleware
.
use
(
Gitlab
::
Metrics
::
RackMiddleware
)
config
.
middleware
.
use
(
Gitlab
::
Middleware
::
RailsQueueDuration
)
config
.
middleware
.
use
(
Gitlab
::
Middleware
::
RailsQueueDuration
)
config
.
middleware
.
use
(
Gitlab
::
Metrics
::
RedisRackMiddleware
)
config
.
middleware
.
use
(
Gitlab
::
Metrics
::
ElasticsearchRackMiddleware
)
config
.
middleware
.
use
(
Gitlab
::
Metrics
::
ElasticsearchRackMiddleware
)
end
end
...
...
doc/administration/monitoring/prometheus/gitlab_metrics.md
View file @
6332d6ec
...
@@ -97,8 +97,6 @@ The following metrics are available:
...
@@ -97,8 +97,6 @@ The following metrics are available:
|
`gitlab_transaction_db_count_total`
| Counter | 13.1 | Counter for total number of SQL calls |
`controller`
,
`action`
|
|
`gitlab_transaction_db_count_total`
| Counter | 13.1 | Counter for total number of SQL calls |
`controller`
,
`action`
|
|
`gitlab_transaction_db_write_count_total`
| Counter | 13.1 | Counter for total number of write SQL calls |
`controller`
,
`action`
|
|
`gitlab_transaction_db_write_count_total`
| Counter | 13.1 | Counter for total number of write SQL calls |
`controller`
,
`action`
|
|
`gitlab_transaction_db_cached_count_total`
| Counter | 13.1 | Counter for total number of cached SQL calls |
`controller`
,
`action`
|
|
`gitlab_transaction_db_cached_count_total`
| Counter | 13.1 | Counter for total number of cached SQL calls |
`controller`
,
`action`
|
|
`http_redis_requests_duration_seconds`
| Histogram | 13.1 | Redis requests duration during web transactions |
`controller`
,
`action`
|
|
`http_redis_requests_total`
| Counter | 13.1 | Redis requests count during web transactions |
`controller`
,
`action`
|
|
`http_elasticsearch_requests_duration_seconds`
**(STARTER)**
| Histogram | 13.1 | Elasticsearch requests duration during web transactions |
`controller`
,
`action`
|
|
`http_elasticsearch_requests_duration_seconds`
**(STARTER)**
| Histogram | 13.1 | Elasticsearch requests duration during web transactions |
`controller`
,
`action`
|
|
`http_elasticsearch_requests_total`
**(STARTER)**
| Counter | 13.1 | Elasticsearch requests count during web transactions |
`controller`
,
`action`
|
|
`http_elasticsearch_requests_total`
**(STARTER)**
| Counter | 13.1 | Elasticsearch requests count during web transactions |
`controller`
,
`action`
|
|
`pipelines_created_total`
| Counter | 9.4 | Counter of pipelines created | |
|
`pipelines_created_total`
| Counter | 9.4 | Counter of pipelines created | |
...
...
lib/gitlab/metrics/redis_rack_middleware.rb
deleted
100644 → 0
View file @
f5ac701e
# frozen_string_literal: true
module
Gitlab
module
Metrics
# Rack middleware for tracking Redis metrics from Grape and Web requests.
class
RedisRackMiddleware
def
initialize
(
app
)
@app
=
app
end
def
call
(
env
)
transaction
=
Gitlab
::
Metrics
.
current_transaction
@app
.
call
(
env
)
ensure
record_metrics
(
transaction
)
end
private
def
record_metrics
(
transaction
)
query_time
=
Gitlab
::
Instrumentation
::
Redis
.
query_time
request_count
=
Gitlab
::
Instrumentation
::
Redis
.
get_request_count
transaction
.
increment
(
:http_redis_requests_total
,
request_count
)
do
docstring
'Amount of calls to Redis servers during web requests'
end
transaction
.
observe
(
:http_redis_requests_duration_seconds
,
query_time
)
do
docstring
'Query time for Redis servers during web requests'
buckets
Gitlab
::
Instrumentation
::
Redis
::
QUERY_TIME_BUCKETS
end
end
end
end
end
spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb
deleted
100644 → 0
View file @
f5ac701e
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Metrics
::
RedisRackMiddleware
do
let
(
:app
)
{
double
(
:app
)
}
let
(
:middleware
)
{
described_class
.
new
(
app
)
}
let
(
:env
)
{
{}
}
let
(
:transaction
)
{
Gitlab
::
Metrics
::
WebTransaction
.
new
(
env
)
}
before
do
allow
(
app
).
to
receive
(
:call
).
with
(
env
).
and_return
(
'wub wub'
)
end
describe
'#call'
do
let
(
:redis_query_time
)
{
0.1
}
let
(
:redis_requests_count
)
{
2
}
before
do
allow
(
Gitlab
::
Instrumentation
::
Redis
).
to
receive
(
:query_time
)
{
redis_query_time
}
allow
(
Gitlab
::
Instrumentation
::
Redis
).
to
receive
(
:get_request_count
)
{
redis_requests_count
}
allow
(
Gitlab
::
Metrics
).
to
receive
(
:current_transaction
).
and_return
(
transaction
)
end
it
'calls the app'
do
expect
(
middleware
.
call
(
env
)).
to
eq
(
'wub wub'
)
end
it
'records redis metrics'
do
expect
(
transaction
).
to
receive
(
:increment
).
with
(
:http_redis_requests_total
,
redis_requests_count
)
expect
(
transaction
).
to
receive
(
:observe
).
with
(
:http_redis_requests_duration_seconds
,
redis_query_time
)
middleware
.
call
(
env
)
end
it
'records redis metrics if an error is raised'
do
expect
(
transaction
).
to
receive
(
:increment
).
with
(
:http_redis_requests_total
,
redis_requests_count
)
expect
(
transaction
).
to
receive
(
:observe
).
with
(
:http_redis_requests_duration_seconds
,
redis_query_time
)
allow
(
app
).
to
receive
(
:call
).
with
(
env
).
and_raise
(
StandardError
)
expect
{
middleware
.
call
(
env
)
}.
to
raise_error
(
StandardError
)
end
end
end
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