-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into depfu/update/group/rails-6.1.7.9
- Loading branch information
Showing
21 changed files
with
226 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# :nocov: | ||
# frozen_string_literal: true | ||
|
||
return unless Settings.dig(:scc, :metrics, :enabled) | ||
|
||
# Configure prometheus client | ||
Prometheus::Client.config.data_store = Prometheus::Client::DataStores::DirectFileStore.new( | ||
dir: './tmp/prometheus/' | ||
) | ||
|
||
# Configure yabeda | ||
Yabeda.configure do | ||
assign_labels = lambda { | ||
default_tag :environment, Rails.env | ||
default_tag :application, 'rmt' | ||
} | ||
|
||
group :rails, &assign_labels | ||
|
||
group :rails do | ||
counter :started_requests_total, | ||
comment: 'A counter of the total number of HTTP requests rails has started to process.', | ||
tags: %i[controller action format method] | ||
end | ||
end | ||
|
||
# Instrument the request from the start | ||
ActiveSupport::Notifications.subscribe 'start_processing.action_controller' do |*args| | ||
# Match the same event as Yabeda | ||
event = Yabeda::Rails::Event.new(*args) | ||
|
||
Yabeda.rails.started_requests_total.tap do |metric| | ||
labels = event.labels.slice(*metric.tags) | ||
|
||
metric.increment(labels, by: 1) | ||
end | ||
end | ||
# :nocov: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
def configure_prometheus!(puma) | ||
ENV['STARTED_FROM_PUMA'] = '1' | ||
|
||
puma.activate_control_app | ||
puma.plugin :yabeda | ||
puma.plugin :yabeda_prometheus | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class ChangeLocalPathType < ActiveRecord::Migration[6.1] | ||
def up | ||
safety_assured do | ||
change_column :repositories, :local_path, :string, limit: 512 | ||
change_column :downloaded_files, :local_path, :string, limit: 512 | ||
end | ||
end | ||
|
||
def down | ||
change_column :repositories, :local_path, :string | ||
change_column :downloaded_files, :local_path, :string | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.