Ok never mind, in addition had to specify i was posting JSON data. Now i
got a 200 OK response.
Getting this in the log as confirmation:
2015-12-10 18:41:37,476 DEBUG
org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.TimelineWebServices:
*Storing metrics:* {
"metrics" : [ {
"timestamp" : 1432075898000,
"metricname" : "AMBARI_METRICS.SmokeTest.FakeMetric",
"appid" : "amssmoketestfake",
"hostname" : "127.0.0.1",
"starttime" : 1432075898000,
"metrics" : {
"1432075898000" : 0.963781711428,
"1432075899000" : 1.432075898E12
}
} ]
}
The only thing is, i am not able to read it back. I tried to query this via
Phoenix, but not getting anything :0: jdbc:phoenix:localhost:61181:/hbase>* SELECT METRIC_NAME, SERVER_TIME, APP_ID* *. . . . . . . . . . . . . . . . . . . > FROM METRIC_RECORD WHERE APP_ID = 'amssmoketestfake'* *. . . . . . . . . . . . . . . . . . . > ORDER BY SERVER_TIME LIMIT 10;* *+------------------------------------------+------------------------------------------+------------------------------------------+* *| ** METRIC_NAME ** | ** SERVER_TIME ** | ** APP_ID ** |* *+------------------------------------------+------------------------------------------+------------------------------------------+* *+------------------------------------------+------------------------------------------+------------------------------------------+* No rows selected (4.394 seconds) 0: jdbc:phoenix:localhost:61181:/hbase> any ideas ? Thanks - On Thu, Dec 10, 2015 at 9:32 AM, matt Lieber <[email protected]> wrote: > thanks for your answer - > However i get an internal server error with that : > > $* wget --post-data="{* > > * "metrics": [* > > * {* > > * "metricname": "AMBARI_METRICS.SmokeTest.FakeMetric",* > > * "appid": "amssmoketestfake",* > > * "hostname": "127.0.0.1",* > > * "timestamp": 1432075898000,* > > * "starttime": 1432075898000,* > > * "metrics": {* > > * "1432075898000": 0.963781711428,* > > * "1432075899000": 1432075898000* > > * }* > > * }* > > * ]* > > *}" http://127.0.0.1:6188/ws/v1/timeline/metrics/ > <http://127.0.0.1:6188/ws/v1/timeline/metrics/>* > > --2015-12-10 09:24:52-- > http://127.0.0.1:6188/ws/v1/timeline/metrics/%E2%80%8B > > Connecting to 127.0.0.1:6188... connected. > > HTTP request sent, awaiting response... 500 Internal Server Error > > 2015-12-10 09:24:52 ERROR 500: Internal Server Error. > > > > 2015-12-10 17:24:52,074 DEBUG org.mortbay.log: call filter guice > > 2015-12-10 17:24:52,075 WARN > org.apache.hadoop.yarn.webapp.GenericExceptionHandler:* > INTERNAL_SERVER_ERROR* > > javax.ws.rs.WebApplicationException > > at > com.sun.jersey.server.impl.uri.rules.TerminatingRule.accept(TerminatingRule.java:66) > > at > com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) > > at > com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) > > at > com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) > > at > com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) > > at > com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) > > at > com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) > > at > com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:895) > > at > com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:843) > > at > com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:804) > > at > com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) > > at > com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) > > at > com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) > > at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) > > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) > > at > org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter.doFilter(StaticUserWebFilter.java:109) > > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) > > at > org.apache.hadoop.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1243) > > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) > > at org.apache.hadoop.http.NoCacheFilter.doFilter(NoCacheFilter.java:45) > > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) > > at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) > > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > > at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) > > at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:767) > > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) > > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) > > at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > > at org.mortbay.jetty.Server.handle(Server.java:322) > > at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) > > at > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) > > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) > > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) > > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) > > 2015-12-10 17:24:52,078 DEBUG org.mortbay.log: RESPONSE > /ws/v1/timeline/metrics/ 500 > > On Thu, Dec 10, 2015 at 9:14 AM, Dmitry Sen <[email protected]> wrote: > >> >> POST/GET metrics to http://127.0.0.1:6188/ws/v1/timeline/metrics/ >> >> >> ------------------------------ >> *From:* matt Lieber <[email protected]> >> *Sent:* Thursday, December 10, 2015 7:08 PM >> *To:* [email protected] >> *Subject:* Fwd: Posting Metrics to Ambari - Metrics Collector >> >> >> >> hi, >> >> I am trying to post metrics to Ambari. I started the Metric collector in >> Ambari on their sandbox. Then i followed instructions on >> https://cwiki.apache.org/confluence/display/AMBARI/Metrics+Collector+API+Specification >> and posted: >> >> *$ wget --post-data="{* >> >> * "metrics": [* >> >> * {* >> >> * "metricname": "AMBARI_METRICS.SmokeTest.FakeMetric",* >> >> * "appid": "amssmoketestfake",* >> >> * "hostname": "127.0.0.1",* >> >> * "timestamp": 1432075898000,* >> >> * "starttime": 1432075898000,* >> >> * "metrics": {* >> >> * "1432075898000": 0.963781711428,* >> >> * "1432075899000": 1432075898000* >> >> * }* >> >> * }* >> >> * ]* >> >> *}" http://127.0.0.1:6188 <http://127.0.0.1:6188>* >> >> >> --2015-12-10 08:48:42-- (try: 6) http://127.0.0.1:6188/ >> >> Connecting to 127.0.0.1:6188... connected. >> >> HTTP request sent, awaiting response... 302 Found >> >> Location: http://127.0.0.1:6188/applicationhistory [following] >> >> --2015-12-10 08:48:44-- http://127.0.0.1:6188/applicationhistory >> >> Reusing existing connection to 127.0.0.1:6188. >> >> HTTP request sent, awaiting response... 200 OK >> >> Length: 5218 (5.1K) [text/html] >> >> Saving to: `index.html.1' >> >> >> 100%[====================================================================================================================================================>] >> 5,218 --.-K/s in 0s >> >> >> 2015-12-10 08:48:45 (237 MB/s) - `index.html.1' saved [5218/5218] >> >> >> Then i looked at the log, started in debug mode, but cant find a trace of >> the metric ..? >> >> # *cat /var/log/ambari-metrics-collector/ambari-metrics-collector.log | >> grep SmokeTest* >> >> [root@sandbox ~]# >> >> I also looked via a query on Phoenix, but to no availability. >> >> anyone knows what's going on ? >> >> >> cheers, >> Matt >> >> >
