Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Create Ambari alert from kafka ambari metric

Super Guru

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.

2 REPLIES 2

Rising Star

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}}}}"
        }
      }
    }

New Contributor

Hi is there any update on this thread. Please share the URI to use to query AMS to create custom alert.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.