Skip to content

Commit

Permalink
filter alarms by namespace in log-alarm/list
Browse files Browse the repository at this point in the history
  • Loading branch information
icylisper committed Jan 6, 2019
1 parent cf70ccd commit f4d724e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sherlog/log_alarm.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

(defn list [log-group]
(let [filters (log/list-filters log-group)
alarms (metric/describe-alarms (map :name filters))]
(into [] (set/join filters alarms {:name :name}))))
alarms (->> (metric/list-alarms)
(filter #(= (:namespace %) log-group)))]
(into [] (set/join filters alarms {:name :metric}))))

(defn- parse-trigger [trigger]
(let [[op stat threshold] trigger]
Expand Down
1 change: 1 addition & 0 deletions src/sherlog/metric/alarm.clj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
(defn- as-alarm [a]
{:name (.getAlarmName a)
:metric (.getMetricName a)
:namespace (.getNamespace a)
:period (.getPeriod a)
:statistic (.getStatistic a)
:threshold (.getThreshold a)
Expand Down

0 comments on commit f4d724e

Please sign in to comment.