Skip to content

Commit

Permalink
Remove InfluxDB username/password
Browse files Browse the repository at this point in the history
InfluxDB over UDP doesn't use authentication, thus there's no need for
these settings.
  • Loading branch information
Yorick Peterse committed Jan 6, 2016
1 parent bcd2a09 commit 8fdc00b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
2 changes: 0 additions & 2 deletions app/controllers/admin/application_settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def application_setting_params
:metrics_enabled,
:metrics_host,
:metrics_port,
:metrics_username,
:metrics_password,
:metrics_pool_size,
:metrics_timeout,
:metrics_method_call_threshold,
Expand Down
8 changes: 0 additions & 8 deletions app/views/admin/application_settings/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,6 @@
your server configuration specifies a database to store data in when
sending messages to this port, without it metrics data will not be
saved.
.form-group
= f.label :metrics_username, 'InfluxDB username', class: 'control-label col-sm-2'
.col-sm-10
= f.text_field :metrics_username, class: 'form-control'
.form-group
= f.label :metrics_password, 'InfluxDB password', class: 'control-label col-sm-2'
.col-sm-10
= f.text_field :metrics_password, class: 'form-control'
.form-group
= f.label :metrics_pool_size, 'Connection pool size', class: 'control-label col-sm-2'
.col-sm-10
Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20160106164438_remove_influxdb_credentials.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveInfluxdbCredentials < ActiveRecord::Migration
def change
remove_column :application_settings, :metrics_username, :string
remove_column :application_settings, :metrics_password, :string
end
end
20 changes: 9 additions & 11 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20151229112614) do
ActiveRecord::Schema.define(version: 20160106164438) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -50,16 +50,14 @@
t.boolean "shared_runners_enabled", default: true, null: false
t.integer "max_artifacts_size", default: 100, null: false
t.string "runners_registration_token"
t.boolean "require_two_factor_authentication", default: false
t.integer "two_factor_grace_period", default: 48
t.boolean "metrics_enabled", default: false
t.string "metrics_host", default: "localhost"
t.string "metrics_username"
t.string "metrics_password"
t.integer "metrics_pool_size", default: 16
t.integer "metrics_timeout", default: 10
t.integer "metrics_method_call_threshold", default: 10
t.boolean "recaptcha_enabled", default: false
t.boolean "require_two_factor_authentication", default: false
t.integer "two_factor_grace_period", default: 48
t.boolean "metrics_enabled", default: false
t.string "metrics_host", default: "localhost"
t.integer "metrics_pool_size", default: 16
t.integer "metrics_timeout", default: 10
t.integer "metrics_method_call_threshold", default: 10
t.boolean "recaptcha_enabled", default: false
t.string "recaptcha_site_key"
t.string "recaptcha_private_key"
t.integer "metrics_port", default: 8089
Expand Down
6 changes: 1 addition & 5 deletions lib/gitlab/metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ def self.settings
timeout: current_application_settings[:metrics_timeout],
method_call_threshold: current_application_settings[:metrics_method_call_threshold],
host: current_application_settings[:metrics_host],
username: current_application_settings[:metrics_username],
password: current_application_settings[:metrics_password],
port: current_application_settings[:metrics_port]
}
end
Expand Down Expand Up @@ -90,12 +88,10 @@ def self.escape_value(value)
if enabled?
@pool = ConnectionPool.new(size: settings[:pool_size], timeout: settings[:timeout]) do
host = settings[:host]
user = settings[:username]
pw = settings[:password]
port = settings[:port]

InfluxDB::Client.
new(udp: { host: host, port: port }, username: user, password: pw)
new(udp: { host: host, port: port })
end
end
end
Expand Down

0 comments on commit 8fdc00b

Please sign in to comment.