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
7131ad46
Commit
7131ad46
authored
Jun 05, 2019
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds sidekiq worker label for ruby metrics
parent
8cd197a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
7 deletions
+1
-7
config/initializers/7_prometheus_metrics.rb
config/initializers/7_prometheus_metrics.rb
+0
-6
lib/gitlab/metrics/samplers/ruby_sampler.rb
lib/gitlab/metrics/samplers/ruby_sampler.rb
+1
-1
No files found.
config/initializers/7_prometheus_metrics.rb
View file @
7131ad46
...
@@ -19,12 +19,6 @@ Gitlab::Application.configure do |config|
...
@@ -19,12 +19,6 @@ Gitlab::Application.configure do |config|
config
.
middleware
.
insert
(
1
,
Gitlab
::
Metrics
::
RequestsRackMiddleware
)
config
.
middleware
.
insert
(
1
,
Gitlab
::
Metrics
::
RequestsRackMiddleware
)
end
end
Sidekiq
.
configure_server
do
|
config
|
config
.
on
(
:startup
)
do
Gitlab
::
Metrics
::
SidekiqMetricsExporter
.
instance
.
start
end
end
if
!
Rails
.
env
.
test?
&&
Gitlab
::
Metrics
.
prometheus_metrics_enabled?
if
!
Rails
.
env
.
test?
&&
Gitlab
::
Metrics
.
prometheus_metrics_enabled?
Gitlab
::
Cluster
::
LifecycleEvents
.
on_worker_start
do
Gitlab
::
Cluster
::
LifecycleEvents
.
on_worker_start
do
defined?
(
::
Prometheus
::
Client
.
reinitialize_on_pid_change
)
&&
Prometheus
::
Client
.
reinitialize_on_pid_change
defined?
(
::
Prometheus
::
Client
.
reinitialize_on_pid_change
)
&&
Prometheus
::
Client
.
reinitialize_on_pid_change
...
...
lib/gitlab/metrics/samplers/ruby_sampler.rb
View file @
7131ad46
...
@@ -77,10 +77,10 @@ module Gitlab
...
@@ -77,10 +77,10 @@ module Gitlab
end
end
def
worker_label
def
worker_label
return
{
worker:
'sidekiq'
}
if
Sidekiq
.
server?
return
{}
unless
defined?
(
Unicorn
::
Worker
)
return
{}
unless
defined?
(
Unicorn
::
Worker
)
worker_no
=
::
Prometheus
::
Client
::
Support
::
Unicorn
.
worker_id
worker_no
=
::
Prometheus
::
Client
::
Support
::
Unicorn
.
worker_id
if
worker_no
if
worker_no
{
worker:
worker_no
}
{
worker:
worker_no
}
else
else
...
...
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