diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-24 14:36:31 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-24 14:36:31 +0100 |
commit | 4d2be5bbec25d60a8d478bda5bc83159f2c845b1 (patch) | |
tree | c3c28a833ccd2a6628d928acee44e62ccfcc6fd8 /config | |
parent | 1a2d180e3dfd8bdad94766a2e8b1195288c2b146 (diff) | |
parent | d4c4dec80dc3abd39116440a3c291c19b27258e1 (diff) | |
download | gitlab-ce-4d2be5bbec25d60a8d478bda5bc83159f2c845b1.tar.gz |
Merge branch 'master' into sidebar-fly-out-sub-nav
Diffstat (limited to 'config')
-rw-r--r-- | config/boot.rb | 5 | ||||
-rw-r--r-- | config/environments/test.rb | 2 | ||||
-rw-r--r-- | config/gitlab.yml.example | 6 | ||||
-rw-r--r-- | config/initializers/7_prometheus_metrics.rb | 12 | ||||
-rw-r--r-- | config/initializers/lograge.rb | 2 | ||||
-rw-r--r-- | config/prometheus/additional_metrics.yml | 23 | ||||
-rw-r--r-- | config/routes/project.rb | 6 | ||||
-rw-r--r-- | config/routes/uploads.rb | 8 | ||||
-rw-r--r-- | config/webpack.config.js | 2 |
9 files changed, 48 insertions, 18 deletions
diff --git a/config/boot.rb b/config/boot.rb index 2d01092acd5..f2830ae3166 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -4,8 +4,3 @@ require 'rubygems' ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) - -# set default directory for multiproces metrics gathering -if ENV['RAILS_ENV'] == 'development' || ENV['RAILS_ENV'] == 'test' - ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_multiproc_dir' -end diff --git a/config/environments/test.rb b/config/environments/test.rb index 986107150cf..278144b8943 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -45,7 +45,7 @@ Rails.application.configure do config.active_job.queue_adapter = :test if ENV['CI'] && !ENV['RAILS_ENABLE_TEST_LOG'] - config.logger = Logger.new(nil) + config.logger = ActiveSupport::TaggedLogging.new(Logger.new(nil)) config.log_level = :fatal end end diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index d0ab2dab0af..cb007813b65 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -383,13 +383,13 @@ production: &base # service_validate_url: '/cas/p3/serviceValidate', # logout_url: '/cas/logout'} } # - { name: 'authentiq', - # # for client credentials (client ID and secret), go to https://www.authentiq.com/ + # # for client credentials (client ID and secret), go to https://www.authentiq.com/developers # app_id: 'YOUR_CLIENT_ID', # app_secret: 'YOUR_CLIENT_SECRET', # args: { # scope: 'aq:name email~rs address aq:push' - # # redirect_uri parameter is optional except when 'gitlab.host' in this file is set to 'localhost' - # # redirect_uri: 'YOUR_REDIRECT_URI' + # # callback_url parameter is optional except when 'gitlab.host' in this file is set to 'localhost' + # # callback_url: 'YOUR_CALLBACK_URL' # } # } # - { name: 'github', diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb new file mode 100644 index 00000000000..987324a86c9 --- /dev/null +++ b/config/initializers/7_prometheus_metrics.rb @@ -0,0 +1,12 @@ +require 'prometheus/client' + +Prometheus::Client.configure do |config| + config.logger = Rails.logger + + config.initial_mmap_file_size = 4 * 1024 + config.multiprocess_files_dir = ENV['prometheus_multiproc_dir'] + + if Rails.env.development? && Rails.env.test? + config.multiprocess_files_dir ||= Rails.root.join('tmp/prometheus_multiproc_dir') + end +end diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index 14902316240..c9a515dfcd5 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -13,7 +13,7 @@ unless Sidekiq.server? # Add request parameters to log output config.lograge.custom_options = lambda do |event| { - time: event.time, + time: event.time.utc.iso8601(3), params: event.payload[:params].except(%w(controller action format)) } end diff --git a/config/prometheus/additional_metrics.yml b/config/prometheus/additional_metrics.yml index 60355e9140c..61d39e7bfcf 100644 --- a/config/prometheus/additional_metrics.yml +++ b/config/prometheus/additional_metrics.yml @@ -1,3 +1,24 @@ +- group: HA Proxy + priority: 10 + metrics: + - title: "Throughput" + y_label: "Requests / Sec" + required_metrics: + - haproxy_frontend_http_requests_total + weight: 1 + queries: + - query_range: 'sum(rate(haproxy_frontend_http_requests_total{%{environment_filter}}[2m]))' + label: Total + unit: req / sec + - title: "HTTP Error Rate" + y_label: "Error Rate (%)" + required_metrics: + - haproxy_frontend_http_responses_total + weight: 1 + queries: + - query_range: 'sum(rate(haproxy_frontend_http_responses_total{code="5xx",%{environment_filter}}[2m])) / sum(rate(haproxy_frontend_http_responses_total{%{environment_filter}}[2m]))' + label: HTTP Errors + unit: "%" - group: AWS Elastic Load Balancer priority: 10 metrics: @@ -56,7 +77,7 @@ - nginx_responses_total weight: 1 queries: - - query_range: 'sum(nginx_responses_total{status_code="5xx", %{environment_filter}}) / sum(nginx_responses_total{server_zone!="*", server_zone!="_", %{environment_filter}})' + - query_range: 'sum(rate(nginx_responses_total{status_code="5xx", %{environment_filter}}[2m])) / sum(rate(nginx_requests_total{server_zone!="*", server_zone!="_", %{environment_filter}}[2m]))' label: HTTP Errors unit: "%" - group: Kubernetes diff --git a/config/routes/project.rb b/config/routes/project.rb index 62cab25c763..06928c7b9ce 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -272,7 +272,7 @@ constraints(ProjectUrlConstrainer.new) do namespace :registry do resources :repository, only: [] do resources :tags, only: [:destroy], - constraints: { id: Gitlab::Regex.container_registry_reference_regex } + constraints: { id: Gitlab::Regex.container_registry_tag_regex } end end @@ -379,7 +379,9 @@ constraints(ProjectUrlConstrainer.new) do collection do scope '*ref', constraints: { ref: Gitlab::PathRegex.git_reference_regex } do constraints format: /svg/ do - get :build + # Keep around until 10.0, see gitlab-org/gitlab-ce#35307 + get :build, to: "badges#pipeline" + get :pipeline get :coverage end end diff --git a/config/routes/uploads.rb b/config/routes/uploads.rb index a49e244af1a..e9c9aa8b2f9 100644 --- a/config/routes/uploads.rb +++ b/config/routes/uploads.rb @@ -1,21 +1,21 @@ scope path: :uploads do # Note attachments and User/Group/Project avatars - get "system/:model/:mounted_as/:id/:filename", + get "-/system/:model/:mounted_as/:id/:filename", to: "uploads#show", constraints: { model: /note|user|group|project/, mounted_as: /avatar|attachment/, filename: /[^\/]+/ } # show uploads for models, snippets (notes) available for now - get ':model/:id/:secret/:filename', + get 'system/:model/:id/:secret/:filename', to: 'uploads#show', constraints: { model: /personal_snippet/, id: /\d+/, filename: /[^\/]+/ } # show temporary uploads - get 'temp/:secret/:filename', + get 'system/temp/:secret/:filename', to: 'uploads#show', constraints: { filename: /[^\/]+/ } # Appearance - get "system/:model/:mounted_as/:id/:filename", + get "-/system/:model/:mounted_as/:id/:filename", to: "uploads#show", constraints: { model: /appearance/, mounted_as: /logo|header_logo/, filename: /.+/ } diff --git a/config/webpack.config.js b/config/webpack.config.js index 1113241e402..a7d92bc53b7 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -56,7 +56,7 @@ var config = { pipelines_details: './pipelines/pipeline_details_bundle.js', profile: './profile/profile_bundle.js', prometheus_metrics: './prometheus_metrics', - protected_branches: './protected_branches/protected_branches_bundle.js', + protected_branches: './protected_branches', protected_tags: './protected_tags', sidebar: './sidebar/sidebar_bundle.js', schedule_form: './pipeline_schedules/pipeline_schedule_form_bundle.js', |