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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Available options
```
Usage: gluster-metrics-exporter [OPTIONS]
--metrics-path=URL Metrics Path (default: /metrics)
--host-binding Exporter bind address (default: 0.0.0.0)
-p PORT, --port=PORT Exporter Port (default: 9713)
--cluster=NAME Cluster identifier
--gluster-host=NAME Gluster Host to replace `localhost` from the peer command output (default: hostname)
Expand Down
4 changes: 4 additions & 0 deletions src/args.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module GlusterMetricsExporter
@@config.metrics_path = url
end

parser.on("--host-binding=HOST", "Bind to specific IP address (default: #{@@config.host_binding})") do |host|
@@config.host_binding = host
end

parser.on("-p PORT", "--port=PORT", "Exporter Port (default: #{@@config.port})") do |port|
@@config.port = port.to_i
end
Expand Down
1 change: 1 addition & 0 deletions src/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module GlusterMetricsExporter
include YAML::Serializable

property metrics_path = "/metrics",
host_binding = "0.0.0.0",
port = 9713,
gluster_executable_path = "/usr/sbin/gluster",
log_level = "info",
Expand Down
1 change: 1 addition & 0 deletions src/gluster-metrics-exporter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module GlusterMetricsExporter

Crometheus.default_registry.path = @@config.metrics_path
Kemal.config.port = @@config.port
Kemal.config.host_binding = @@config.host_binding
Kemal.config.logger = ExporterAPILogHandler.new
Kemal.run
end
Expand Down
Loading