mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
parent
b314800abc
commit
a9e474f0e1
2 changed files with 6 additions and 2 deletions
|
@ -20,7 +20,9 @@ module LogStash
|
|||
end
|
||||
|
||||
def http_address
|
||||
service.agent.webserver.address
|
||||
@http_address ||= service.get_shallow(:http_address).value
|
||||
rescue ::LogStash::Instrument::MetricStore::MetricNotFound, NoMethodError => e
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,7 +20,9 @@ end
|
|||
module LogStash
|
||||
class DummyAgent < Agent
|
||||
def start_webserver
|
||||
@webserver = Struct.new(:address).new("#{Socket.gethostname}:#{::LogStash::WebServer::DEFAULT_PORTS.first}")
|
||||
http_address = "#{Socket.gethostname}:#{::LogStash::WebServer::DEFAULT_PORTS.first}"
|
||||
@webserver = Struct.new(:address).new(http_address)
|
||||
self.metric.gauge([], :http_address, http_address)
|
||||
end
|
||||
def stop_webserver; end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue