Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ With following configuration, you can access http://localhost:24231/metrics on a

More configuration parameters:

- `bind`: binding interface (default: '0.0.0.0')
- `bind`: binding interface (default: '127.0.0.1')
- `port`: listen port (default: 24231)
- `metrics_path`: metrics HTTP endpoint (default: /metrics)
- `aggregated_metrics_path`: metrics HTTP endpoint (default: /aggregated_metrics)
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_prometheus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PrometheusInput < Fluent::Plugin::Input

helpers :thread, :http_server

config_param :bind, :string, default: '0.0.0.0'
config_param :bind, :string, default: '127.0.0.1'
config_param :port, :integer, default: 24231
config_param :metrics_path, :string, default: '/metrics'
config_param :aggregated_metrics_path, :string, default: '/aggregated_metrics'
Expand Down
9 changes: 8 additions & 1 deletion spec/fluent/plugin/in_prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@
describe '#configure' do
describe 'bind' do
let(:config) { CONFIG + %[
bind 127.0.0.1
bind ::1
] }
it 'should be configurable' do
expect(driver.instance.bind).to eq('::1')
end
end

describe 'default bind' do
let(:config) { CONFIG }
it 'should be accessible from 127.0.0.1 by default' do
expect(driver.instance.bind).to eq('127.0.0.1')
end
end
Expand Down