I'm trying to work on sending a custom metric to the Ambari Metric collector. I've been following this extremely helpful blog. http://bryanbende.com/development/2015/07/31/ambari-metrics-part1-metrics-collector
Whenever I make a POST, however, I get a response 500 with this error:
"com.sun.jersey.api.MessageException: A message body reader for Java class org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics, and Java type class org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics, and MIME media type application/octet-stream was not found."
Followed by a list of compatible readers.
Here's what I'm posting (except as a string with no whitespace) - it's pulled straight from the example here https://cwiki.apache.org/confluence/display/AMBARI/Metrics+Collector+API+Specification
The url I'm pointing at is http://<metrics-collector-host>:6188/ws/v1/timeline/metrics/
A few things I've tried:
- POSTing to both on the cluster I made from VMs to experiment with and with the official Hortonworks sandbox (as suggested in Bryan's tutorial - making sure port forwarding is set up). Neither works.
- Restarting Ambari Metrics
- Having Ambari Metrics run it's service check, which, from what I can tell, posts and gets a dummy metric. It worked fine.
- Doing a GET request. Get requests are successful and do return the requested metrics.
- Sending the POST from my local machine, the primary VM, and the VM that the metrics collector lives on.
- Editing the "hostname" field in the json doc to match what machine I'm sending from (though that seems as though it shouldn't matter)
Thanks in advance!