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
d2146775
Commit
d2146775
authored
Apr 29, 2021
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Structured Logger
- Insert SidekiqServerMiddelware after Instrumentation Logger
parent
5ff51c71
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
ee/lib/ee/gitlab/sidekiq_middleware.rb
ee/lib/ee/gitlab/sidekiq_middleware.rb
+1
-1
ee/spec/lib/ee/gitlab/sidekiq_middleware_spec.rb
ee/spec/lib/ee/gitlab/sidekiq_middleware_spec.rb
+1
-1
lib/gitlab/sidekiq_logging/structured_logger.rb
lib/gitlab/sidekiq_logging/structured_logger.rb
+1
-1
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
+10
-0
No files found.
ee/lib/ee/gitlab/sidekiq_middleware.rb
View file @
d2146775
...
...
@@ -13,7 +13,7 @@ module EE
super
.
call
(
chain
)
if
load_balancing_enabled?
chain
.
insert_after
(
::
Labkit
::
Middleware
::
Sidekiq
::
Serv
er
,
chain
.
insert_after
(
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogg
er
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
)
end
end
...
...
ee/spec/lib/ee/gitlab/sidekiq_middleware_spec.rb
View file @
d2146775
...
...
@@ -62,8 +62,8 @@ RSpec.describe Gitlab::SidekiqMiddleware do
::
Gitlab
::
SidekiqMiddleware
::
ExtraDoneLogMetadata
,
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
,
::
Labkit
::
Middleware
::
Sidekiq
::
Server
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
,
::
Gitlab
::
SidekiqVersioning
::
Middleware
,
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
,
...
...
lib/gitlab/sidekiq_logging/structured_logger.rb
View file @
d2146775
...
...
@@ -39,7 +39,7 @@ module Gitlab
private
def
add_instrumentation_keys!
(
job
,
output_payload
)
output_payload
.
merge!
(
job
[
:instrumentation
].
stringify_keys
)
output_payload
.
merge!
(
job
[
:instrumentation
].
stringify_keys
)
if
job
[
:instrumentation
]
end
def
add_logging_extras!
(
job
,
output_payload
)
...
...
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
View file @
d2146775
...
...
@@ -293,6 +293,16 @@ RSpec.describe Gitlab::SidekiqLogging::StructuredLogger do
end
end
end
context
'when instrumentation data is not loaded'
do
before
do
allow
(
logger
).
to
receive
(
:info
)
end
it
'does not raise exception'
do
expect
{
subject
.
call
(
job
.
dup
,
'test_queue'
)
{}
}.
not_to
raise_error
end
end
end
describe
'#add_time_keys!'
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