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
95c60178
Commit
95c60178
authored
May 06, 2021
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-structured-logger' into 'master'
Fix Structured Logger See merge request gitlab-org/gitlab!60632
parents
450a22dd
d2146775
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 @
95c60178
...
@@ -13,7 +13,7 @@ module EE
...
@@ -13,7 +13,7 @@ module EE
super
.
call
(
chain
)
super
.
call
(
chain
)
if
load_balancing_enabled?
if
load_balancing_enabled?
chain
.
insert_after
(
::
Labkit
::
Middleware
::
Sidekiq
::
Serv
er
,
chain
.
insert_after
(
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogg
er
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
)
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
)
end
end
end
end
...
...
ee/spec/lib/ee/gitlab/sidekiq_middleware_spec.rb
View file @
95c60178
...
@@ -62,8 +62,8 @@ RSpec.describe Gitlab::SidekiqMiddleware do
...
@@ -62,8 +62,8 @@ RSpec.describe Gitlab::SidekiqMiddleware do
::
Gitlab
::
SidekiqMiddleware
::
ExtraDoneLogMetadata
,
::
Gitlab
::
SidekiqMiddleware
::
ExtraDoneLogMetadata
,
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
,
::
Gitlab
::
SidekiqMiddleware
::
BatchLoader
,
::
Labkit
::
Middleware
::
Sidekiq
::
Server
,
::
Labkit
::
Middleware
::
Sidekiq
::
Server
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
,
::
Gitlab
::
SidekiqMiddleware
::
InstrumentationLogger
,
::
Gitlab
::
Database
::
LoadBalancing
::
SidekiqServerMiddleware
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
,
::
Gitlab
::
SidekiqMiddleware
::
AdminMode
::
Server
,
::
Gitlab
::
SidekiqVersioning
::
Middleware
,
::
Gitlab
::
SidekiqVersioning
::
Middleware
,
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
,
::
Gitlab
::
SidekiqStatus
::
ServerMiddleware
,
...
...
lib/gitlab/sidekiq_logging/structured_logger.rb
View file @
95c60178
...
@@ -39,7 +39,7 @@ module Gitlab
...
@@ -39,7 +39,7 @@ module Gitlab
private
private
def
add_instrumentation_keys!
(
job
,
output_payload
)
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
end
def
add_logging_extras!
(
job
,
output_payload
)
def
add_logging_extras!
(
job
,
output_payload
)
...
...
spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
View file @
95c60178
...
@@ -293,6 +293,16 @@ RSpec.describe Gitlab::SidekiqLogging::StructuredLogger do
...
@@ -293,6 +293,16 @@ RSpec.describe Gitlab::SidekiqLogging::StructuredLogger do
end
end
end
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
end
describe
'#add_time_keys!'
do
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