Created 07-12-2018 04:15 PM
I am able to get a metric from ambari using the following request:
curl -u *****:**** -H "X-Requested-by:ambari" -i -k -X GET http://server:6188/ws/v1/timeline/metrics?metricNames=kafka.server.BrokerTopicMetrics.MessagesInPerS...
How can I create a alert on this metric? I have read https://community.hortonworks.com/questions/39457/kafka-custom-alert-with-ambari-222.html which requires a python script. How can I nativly use the metrics from ambari/grafana to create a alert.
Created 07-12-2018 04:46 PM
I believe this doc contains the information you're looking for: https://github.com/apache/ambari/blob/branch-2.1/ambari-server/docs/api/v1/alert-definitions.md#metr...
METRIC METRIC source fields are used to define JMX endpoints that can be queried for values. The source/reporting and jmx/value fields are parameterized to match the property_list specified. "source" : { "jmx" : { "property_list" : [ "java.lang:type=OperatingSystem/SystemCpuLoad", "java.lang:type=OperatingSystem/AvailableProcessors" ], "value" : "{0} * 100" }, "reporting" : { "ok" : { "text" : "{1} CPU, load {0:.1%}" }, "warning" : { "text" : "{1} CPU, load {0:.1%}", "value" : 200.0 }, "critical" : { "text" : "{1} CPU, load {0:.1%}", "value" : 250.0 }, "units" : "%" }, "type" : "METRIC", "uri" : { "http" : "{{hdfs-site/dfs.namenode.http-address}}", "https" : "{{hdfs-site/dfs.namenode.https-address}}", "https_property" : "{{hdfs-site/dfs.http.policy}}", "https_property_value" : "HTTPS_ONLY", "default_port" : 0.0, "high_availability" : { "nameservice" : "{{hdfs-site/dfs.nameservices}}", "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}", "http_pattern" : "{{hdfs-site/dfs.namenode.http-address.{{ha-nameservice}}.{{alias}}}}", "https_pattern" : "{{hdfs-site/dfs.namenode.https-address.{{ha-nameservice}}.{{alias}}}}" } } }
Created 03-28-2019 02:01 PM
Hi is there any update on this thread. Please share the URI to use to query AMS to create custom alert.