----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45873/#review127769 -----------------------------------------------------------
Fix it, then Ship it! ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py (line 24) <https://reviews.apache.org/r/45873/#comment191154> Why not urllib2? ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py (lines 66 - 70) <https://reviews.apache.org/r/45873/#comment191153> Since this is contacting AMS, is there a better place to get this information from, like the AMS configurations? ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py (lines 117 - 118) <https://reviews.apache.org/r/45873/#comment191156> Any reason you chose to use httplib here instead of urllib2? I think that urllib2 handles more for you automatically, like redirects and stuff. If there's a good reason or you don't think urllib2 is a good fit, then you can disregard this. - Jonathan Hurley On April 7, 2016, 11:24 a.m., Dmytro Sen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45873/ > ----------------------------------------------------------- > > (Updated April 7, 2016, 11:24 a.m.) > > > Review request for Ambari, Aravindan Vijayan, Jonathan Hurley, and Sid Wagle. > > > Bugs: AMBARI-15766 > https://issues.apache.org/jira/browse/AMBARI-15766 > > > Repository: ambari > > > Description > ------- > > There are a few requirements around creating alerts based on the time-series > data stored in AMS. They fall in the the general category of: > - identify a metrics (name of the metrics, app name) > - identify a window (e.g. last 10 minutes, last 1 day) > - get the data points > - add them up, or > - compute average, or > - compute standard deviations, or > - ... > - compare the value to a threshold > - emit an alert if needed (WARN, CRITICAL, etc) > > We should also allow for alerts based on multiple metrics but there is no ask > for such a capability. Just something to keep in mind while designing. > It seems general enough that we should define an alert type that can be > instantiated by services to define specific alerts. Users can add additional > alerts if they so choose. > > > Diffs > ----- > > ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py b84832d > ambari-agent/src/main/python/ambari_agent/alerts/ams_alert.py PRE-CREATION > ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py d177bd4 > ambari-agent/src/test/python/ambari_agent/TestAlertSchedulerHandler.py > f4e7ba1 > ambari-agent/src/test/python/ambari_agent/TestAlerts.py e5f6a41 > ambari-agent/src/test/python/ambari_agent/TestAmsAlert.py PRE-CREATION > ambari-common/src/main/python/ambari_commons/aggregation_functions.py > PRE-CREATION > ambari-common/src/main/python/ambari_commons/firewall.py 64d396b > ambari-common/src/main/python/ambari_commons/urllib_handlers.py aa2e3f6 > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java > 1676b53 > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/AmsSource.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java > 2ff438d > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/SourceType.java > 357baf9 > ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json > 3612de2 > > ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py > 038592f > > ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java > 10b92d4 > > Diff: https://reviews.apache.org/r/45873/diff/ > > > Testing > ------- > > Unit tests passed > > > Thanks, > > Dmytro Sen > >