diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/api/api.rb | 3 | ||||
| -rw-r--r-- | lib/api/helpers.rb | 4 | ||||
| -rw-r--r-- | lib/api/job_artifacts.rb | 4 | ||||
| -rw-r--r-- | lib/gitlab/grape_logging/loggers/context_logger.rb | 14 | ||||
| -rw-r--r-- | lib/gitlab/lograge/custom_options.rb | 2 | ||||
| -rw-r--r-- | lib/gitlab/usage_data.rb | 1 | ||||
| -rw-r--r-- | lib/gitlab/workhorse.rb | 3 | ||||
| -rw-r--r-- | lib/support/init.d/gitlab.default.example | 4 |
8 files changed, 26 insertions, 9 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 86ddd6e57bc..b8135539cda 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -24,7 +24,8 @@ module API Gitlab::GrapeLogging::Loggers::ExceptionLogger.new, Gitlab::GrapeLogging::Loggers::QueueDurationLogger.new, Gitlab::GrapeLogging::Loggers::PerfLogger.new, - Gitlab::GrapeLogging::Loggers::CorrelationIdLogger.new + Gitlab::GrapeLogging::Loggers::CorrelationIdLogger.new, + Gitlab::GrapeLogging::Loggers::ContextLogger.new ] allow_access_with_scope :api diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 2561be148ac..c6f6dc255d4 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -609,8 +609,8 @@ module API header(*Gitlab::Workhorse.send_git_archive(repository, **kwargs)) end - def send_artifacts_entry(build, entry) - header(*Gitlab::Workhorse.send_artifacts_entry(build, entry)) + def send_artifacts_entry(file, entry) + header(*Gitlab::Workhorse.send_artifacts_entry(file, entry)) end # The Grape Error Middleware only has access to `env` but not `params` nor diff --git a/lib/api/job_artifacts.rb b/lib/api/job_artifacts.rb index 920938ad453..6a82256cc96 100644 --- a/lib/api/job_artifacts.rb +++ b/lib/api/job_artifacts.rb @@ -54,7 +54,7 @@ module API bad_request! unless path.valid? - send_artifacts_entry(build, path) + send_artifacts_entry(build.artifacts_file, path) end desc 'Download the artifacts archive from a job' do @@ -90,7 +90,7 @@ module API bad_request! unless path.valid? - send_artifacts_entry(build, path) + send_artifacts_entry(build.artifacts_file, path) end desc 'Keep the artifacts to prevent them from being deleted' do diff --git a/lib/gitlab/grape_logging/loggers/context_logger.rb b/lib/gitlab/grape_logging/loggers/context_logger.rb new file mode 100644 index 00000000000..0a8f0872fbe --- /dev/null +++ b/lib/gitlab/grape_logging/loggers/context_logger.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This module adds additional correlation id the grape logger +module Gitlab + module GrapeLogging + module Loggers + class ContextLogger < ::GrapeLogging::Loggers::Base + def parameters(_, _) + Labkit::Context.current.to_h + end + end + end + end +end diff --git a/lib/gitlab/lograge/custom_options.rb b/lib/gitlab/lograge/custom_options.rb index 68402ef2184..55c46c365f6 100644 --- a/lib/gitlab/lograge/custom_options.rb +++ b/lib/gitlab/lograge/custom_options.rb @@ -23,6 +23,8 @@ module Gitlab queue_duration_s: event.payload[:queue_duration_s] } + payload.merge!(event.payload[:metadata]) if event.payload[:metadata] + ::Gitlab::InstrumentationHelper.add_instrumentation_data(payload) payload[:response] = event.payload[:response] if event.payload[:response] diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 2847a1f5d90..e60c786b52c 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -114,6 +114,7 @@ module Gitlab issues_with_associated_zoom_link: count(ZoomMeeting.added_to_issue), issues_using_zoom_quick_actions: distinct_count(ZoomMeeting, :issue_id), issues_with_embedded_grafana_charts_approx: grafana_embed_usage_data, + issues_created_gitlab_alerts: count(Issue.with_alert_management_alerts.not_authored_by(::User.alert_bot)), incident_issues: alert_bot_incident_count, alert_bot_incident_issues: alert_bot_incident_count, incident_labeled_issues: count(::Issue.with_label_attributes(IncidentManagement::CreateIssueService::INCIDENT_LABEL)), diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb index 75196a03edc..c91d1b05440 100644 --- a/lib/gitlab/workhorse.rb +++ b/lib/gitlab/workhorse.rb @@ -130,8 +130,7 @@ module Gitlab ] end - def send_artifacts_entry(build, entry) - file = build.artifacts_file + def send_artifacts_entry(file, entry) archive = file.file_storage? ? file.path : file.url params = { diff --git a/lib/support/init.d/gitlab.default.example b/lib/support/init.d/gitlab.default.example index 529ebf49d45..1b499467ad6 100644 --- a/lib/support/init.d/gitlab.default.example +++ b/lib/support/init.d/gitlab.default.example @@ -26,8 +26,8 @@ pid_path="$app_root/tmp/pids" socket_path="$app_root/tmp/sockets" # web_server_pid_path defines the path in which to create the pid file fo the web_server -# The default is "$pid_path/unicorn.pid" -web_server_pid_path="$pid_path/unicorn.pid" +# The default is "$pid_path/puma.pid" +web_server_pid_path="$pid_path/puma.pid" # sidekiq_pid_path defines the path in which to create the pid file for sidekiq # The default is "$pid_path/sidekiq.pid" |
