<div dir="ltr">Hi Tristan!<div><br></div><div>I&#39;ve been investigating the possibility of integrating with WF monitoring endpoint and I found this article: [1].</div><div><br></div><div>If I understand the Infinispan and Wildfly integration bits correctly - all we need to do is to implement additional resources in [2]. This should make the new API available through CLI as well as through REST [1].</div><div><br></div><div>The biggest advantage of this solution is that one implementation solves both REST and CLI use cases at the same time. However there are some drawbacks too - we won&#39;t be able to support any custom queries (we are limited only to queries supported by WF bits) and the REST api will be a bit complicated to consume:</div><div><ul><li>Imaginary examples based on [1]:</li><ul><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">curl <a href="http://localhost:9990/management/subsystem=datagrid-infinispan/cache-container=local?operation=health&amp;recursive=true&amp;json.pretty=1">http://localhost:9990/management/subsystem=datagrid-infinispan/cache-container=local?operation=health&amp;recursive=true&amp;json.pretty=1</a></span></font></li><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">curl <a href="http://localhost:9990/management/subsystem=datagrid-infinispan/cache-container=local/local-cache=default?operation=health&amp;json.pretty=1">http://localhost:9990/management/subsystem=datagrid-infinispan/cache-container=local/local-cache=default?operation=health&amp;json.pretty=1</a></span></font></li></ul><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">An example what ElasticSearch does [3]:</span></font></li><ul><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">curl &#39;<a href="http://localhost:9200/_cluster/health?pretty=true">http://localhost:9200/_cluster/health?pretty=true</a>&#39;</span><br></font></li></ul><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">An example what Spring Actuator does [4]:</span></font></li><ul><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap"><span style="font-size:12.6667px;line-height:15.2px">curl &#39;<a href="http://localhost:8080/health">http://localhost:8080/health</a>&#39;</span><br></span></font></li><li><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap"><span style="font-size:12.6667px;line-height:15.2px"><span style="font-size:12.6667px;line-height:15.2px">curl &#39;<a href="http://localhost:8080/metrics">http://localhost:8080/metrics</a>&#39;</span><br></span></span></font></li></ul></ul><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">If I&#39;m right - we will need to document this feature correctly since those URLs are not very intuitive. WDYT?</span></font></div></div><div><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">Thanks</span></font></div><div><font color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="font-size:12.6667px;line-height:15.2px;white-space:pre-wrap">Sebastian</span></font></div><div><br></div><div>[1] <a href="https://docs.jboss.org/author/display/WFLY10/The+HTTP+management+API">https://docs.jboss.org/author/display/WFLY10/The+HTTP+management+API</a></div><div>[2] <a href="https://github.com/infinispan/infinispan/tree/master/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem">https://github.com/infinispan/infinispan/tree/master/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem</a></div><div>[3] <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html</a></div><div>[4] <a href="https://spring.io/guides/gs/actuator-service/">https://spring.io/guides/gs/actuator-service/</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 26, 2016 at 10:34 AM, Tristan Tarrant <span dir="ltr">&lt;<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 26/07/16 10:24, Sebastian Laskawiec wrote:<br>
&gt; Hey Tristan!<br>
&gt;<br>
&gt; Comments inlined.<br>
&gt;<br>
&gt; Thanks<br>
&gt; Sebastian<br>
&gt;<br>
&gt; On Tue, Jul 26, 2016 at 9:50 AM, Tristan Tarrant &lt;<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a><br>
</span><span class="">&gt; &lt;mailto:<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 26/07/16 07:10, Sebastian Laskawiec wrote:<br>
&gt;     &gt; Dear Community,<br>
&gt;     &gt;<br>
&gt;     &gt; I&#39;d like to ask you for help. I&#39;m currently sketching a design for a<br>
&gt;     &gt; REST health check endpoint for Infinispan and I&#39;m trying to imagine<br>
&gt;     &gt; possible use cases.<br>
&gt;     The health-check should be implemented as an MBean initially, with the<br>
&gt;     ability to expose it via alternative implementations later. The server<br>
&gt;     RESTful endpoint should be registered with the management<br>
&gt;     interface via<br>
&gt;     a special handler.<br>
&gt;<br>
&gt;<br>
&gt; Yes, I think it&#39;s a good idea. We could even use tools like Jolokia<br>
&gt; [1] to expose MBeans through REST interface (it can be added to<br>
&gt; standalone.conf to the bootstrap classpath). Alternatively we could<br>
&gt; use JDK embedded HTTP Server [2].<br>
<br>
</span>No, for server we would not use Jolokia but rely on the management HTTP<br>
server (the one that handles port 9990 already).<br>
<div><div class="h5"><br>
&gt;<br>
&gt;     A cache and cachemanager&#39;s health is determined by a combination of<br>
&gt;     parameters and we probably should allow for a user-pluggable<br>
&gt;     checker. We<br>
&gt;     already expose a number of statuses already, although obviously this<br>
&gt;     would be an aggregate.<br>
&gt;<br>
&gt;<br>
&gt; Could you please elaborate more on that? How do we expose this<br>
&gt; information? Are you referring to Infinispan Stats [3]?<br>
&gt;<br>
&gt; I also though about supporting queries somehow. An imaginary example<br>
&gt; from the top of my head could look like the following:<br>
&gt;<br>
&gt; http://$ISPN/_health?cluster.nodes=3&amp;MyCacheManager.MyCache.status=DEGRADED<br>
&gt; //&lt;-- This would return 200 OK if we have 3 nodes and given cache is<br>
&gt; in degraded mode.<br>
&gt; http://$ISPN/_health?cluster.nodes=3&amp;MyCacheManager.rebalance=IN_PROGRESS<br>
&gt; //&lt;-- Checks if we have 3 nodes and rebalance is in proress<br>
&gt;<br>
&gt; [3]<br>
&gt; <a href="https://github.com/infinispan/infinispan/tree/8.2.x/core/src/main/java/org/infinispan/stats" rel="noreferrer" target="_blank">https://github.com/infinispan/infinispan/tree/8.2.x/core/src/main/java/org/infinispan/stats</a><br>
&gt;<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Could you please give me a hand and tell me what functionalities are<br>
&gt;     &gt; important for you? Would you like to be able to check status<br>
&gt;     per-cache<br>
&gt;     &gt; or maybe a red (not healthy), green (healthy), yellow (healthy,<br>
&gt;     &gt; rebalance in progress) cluster status is sufficient? What kind of<br>
&gt;     &gt; information do you expect to be there?<br>
&gt;     I wouldn&#39;t want this to be overly complex: a simple OK, KO should be<br>
&gt;     sufficient. Additional detail may be optionally present, but not a<br>
&gt;     requirement.<br>
&gt;<br>
&gt;<br>
&gt; I think we will need at least a 3rd state - yellow or something like<br>
&gt; this. This would mean that a rebalance is in progress of a node is<br>
&gt; joining/leaving. In other words - the cluster accepts requests but<br>
&gt; don&#39;t touch the nodes!<br>
</div></div>Agreed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tristan<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div>