Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Prometheus timeouts from settings #167

Merged
merged 1 commit into from
Nov 12, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def prometheus_client
end

def prometheus_client_new(uri, credentials, options)
worker_class = ManageIQ::Providers::Kubernetes::ContainerManager::MetricsCollectorWorker

Faraday.new(
:url => uri.to_s,
:proxy => options[:http_proxy_uri].empty? ? nil : options[:http_proxy_uri],
Expand All @@ -18,8 +20,8 @@ def prometheus_client_new(uri, credentials, options)
:cert_store => options[:ssl_cert_store]
},
:request => {
:open_timeout => 2, # opening a connection
:timeout => 5 # waiting for response
:open_timeout => worker_class.worker_settings[:prometheus_open_timeout] || 5,
:timeout => worker_class.worker_settings[:prometheus_request_timeout] || 30
},
:headers => {
:Authorization => "Bearer " + credentials[:token]
Expand Down
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,7 @@
:ems_metrics_collector_worker_kubernetes:
:metrics_port: 5000
:metrics_path: "/hawkular/metrics"
:prometheus_open_timeout: 5
:prometheus_request_timeout: 30
:ems_refresh_worker:
:ems_refresh_worker_kubernetes: {}