Skip to content

Commit

Permalink
Merge pull request #228 from yaacov/recatch-no-metrics
Browse files Browse the repository at this point in the history
recatch the metrics not found error
(cherry picked from commit 9769743)

https://bugzilla.redhat.com/show_bug.cgi?id=1552314
  • Loading branch information
cben authored and simaishi committed Mar 6, 2018
1 parent 73a8d77 commit cdc323e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -97,9 +97,9 @@ def perf_collect_metrics(interval_name, start_time = nil, end_time = nil)
begin
context.collect_metrics
rescue NoMetricsFoundError => e
_log.debug("Metrics unavailable: #{e.message}")
_log.warn("Metrics missing: [#{target_name}] #{e.message}")
rescue StandardError => e
_log.error("Metrics unavailable: #{e.message}")
_log.error("Metrics unavailable: [#{target_name}] #{e.message}")
ems.update_attributes(:last_metrics_error => :unavailable,
:last_metrics_update_date => Time.now.utc) if ems
raise
Expand Down
Expand Up @@ -213,7 +213,7 @@ def insert_metrics(raw_metrics, type)
# "cpu/usage_rate" => "machine/<utl>/cpu/usage_rate"
full_key = get_metrics_key(raw_metrics, 'gauge', key)
unless full_key
raise CollectionFailure, "#{key} missing while query metrics"
raise NoMetricsFoundError, "#{key} missing while query metrics"
end

# insert the raw metrics into the @ts_values global object
Expand Down
Expand Up @@ -93,6 +93,8 @@ def fetch_counters_data(resource, metric_title, conversion_factor = 1)
metric_title,
conversion_factor
)
rescue NoMetricsFoundError
raise
rescue StandardError => e
raise CollectionFailure, "#{e.class.name}: #{e.message}"
end
Expand Down

0 comments on commit cdc323e

Please sign in to comment.