Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Create Ambari alert from kafka ambari metric

Highlighted

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

Re: Create Ambari alert from kafka ambari metric

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

Re: Create Ambari alert from kafka ambari metric

New Contributor

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

Don't have an account?
Coming from Hortonworks? Activate your account here