You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by VincentCE <ve...@cephei.com> on 2021/02/04 14:19:30 UTC

Re: [External]Re: Exporter usage of Ignite 2.8.0

Hi!

We would like to use the prometheus/opencensus exporter for our server nodes
which we start using an xml configuration. Facundo.maldonado mentioned
before that this can be done wrapping the collector and http server in
another bean. This is what I tried which is probably not exactly as
suggested:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">
    <bean abstract="true" id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
        
        <property name="peerClassLoadingEnabled" value="true"/>
        
        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                        <property name="addresses">
                            <list>
                                
                                <value>127.0.0.1:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>

        <property name="metricExporterSpi">
            <bean
class="org.apache.ignite.spi.metric.opencensus.OpenCensusMetricExporterSpi">
              <property name="period" value="1000" />
            </bean>
        </property>
    </bean>

    <bean id="opencensusWrapper"
class="org.springframework.beans.factory.config.MethodInvokingBean">
      <property name="staticMethod"
value="io.opencensus.exporter.stats.prometheus.PrometheusStatsCollector.createAndRegister"
/>
    </bean>

   <bean id="httpServer" class="io.prometheus.client.exporter.HTTPServer">
      <constructor-arg type = "java.lang.String" value = "localhost"/>
      <constructor-arg type = "int" value = "8080"/>
      <constructor-arg type = "boolean" value = "true"/>
  </bean>
</beans>

Using this config the ignite server node starts as desired and the same
holds for the inner http server. However no metrics are collected (Nothing
is displayed on http://localhost:8080/), it seems as if
prometheusStatsCollector is not successfully registering with the internally
used default registry. Can someone see the issue with the above
configuration? 

Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [External]Re: Exporter usage of Ignite 2.8.0

Posted by VincentCE <ve...@cephei.com>.
Thanks for providing the config!
I copied/pasted it into my example-default.xml. Afterwards I started a
server node using ./ignite.sh ../examples/config/example-default.xml. I am
using Ignite 2.8.1 btw.

Unfortunately I am still getting no result. The root cause must lie
somewhere else.
Interestingly enough
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/opencensus/OpenCensusMetricsExporterExample.java
works totally fine. In fact the above config is entirely based on it.

Best,
Vincent



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [External]Re: Exporter usage of Ignite 2.8.0

Posted by Stephen Darlington <st...@gridgain.com>.
I more-or-less just copy-and-pasted your example:

https://github.com/GridGain-Demos/ignite-prometheus/blob/main/src/main/resources/ignite-prometheus.xml

Regards,
Stephen

> On 4 Feb 2021, at 15:41, VincentCE <ve...@cephei.com> wrote:
> 
> Hi Stephen,
> 
> I am glad to here that the configuration works for you! Unfortunately I
> already tried different ports but this didn't solve my problem, also I am
> not running ignites REST server. Could you possibly share the ignite
> configuration which is working for you?
> 
> Best,
> Vincent
> 
> 
> 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



Re: [External]Re: Exporter usage of Ignite 2.8.0

Posted by VincentCE <ve...@cephei.com>.
Hi Stephen,

I am glad to here that the configuration works for you! Unfortunately I
already tried different ports but this didn't solve my problem, also I am
not running ignites REST server. Could you possibly share the ignite
configuration which is working for you?

Best,
Vincent



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: [External]Re: Exporter usage of Ignite 2.8.0

Posted by Stephen Darlington <st...@gridgain.com>.
That’s a good trick! I couldn’t figure out the Spring magic required to call a static method, but that works for me. (I had written a small lifecycle bean, which also works, but this is better.)

I would try to have your collector running on a port other than 8080. That’s a pretty common port for web services, including Ignite’s own REST server if you have that running.

Regards,
Stephen

> On 4 Feb 2021, at 14:19, VincentCE <ve...@cephei.com> wrote:
> 
> Hi!
> 
> We would like to use the prometheus/opencensus exporter for our server nodes
> which we start using an xml configuration. Facundo.maldonado mentioned
> before that this can be done wrapping the collector and http server in
> another bean. This is what I tried which is probably not exactly as
> suggested:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:util="http://www.springframework.org/schema/util"
>       xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://www.springframework.org/schema/util
>        http://www.springframework.org/schema/util/spring-util.xsd">
>    <bean abstract="true" id="ignite.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
> 
>        <property name="peerClassLoadingEnabled" value="true"/>
> 
>        <property name="discoverySpi">
>            <bean
> class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
>                <property name="ipFinder">
>                    <bean
> class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
>                        <property name="addresses">
>                            <list>
> 
>                                <value>127.0.0.1:47500..47509</value>
>                            </list>
>                        </property>
>                    </bean>
>                </property>
>            </bean>
>        </property>
> 
>        <property name="metricExporterSpi">
>            <bean
> class="org.apache.ignite.spi.metric.opencensus.OpenCensusMetricExporterSpi">
>              <property name="period" value="1000" />
>            </bean>
>        </property>
>    </bean>
> 
>    <bean id="opencensusWrapper"
> class="org.springframework.beans.factory.config.MethodInvokingBean">
>      <property name="staticMethod"
> value="io.opencensus.exporter.stats.prometheus.PrometheusStatsCollector.createAndRegister"
> />
>    </bean>
> 
>   <bean id="httpServer" class="io.prometheus.client.exporter.HTTPServer">
>      <constructor-arg type = "java.lang.String" value = "localhost"/>
>      <constructor-arg type = "int" value = "8080"/>
>      <constructor-arg type = "boolean" value = "true"/>
>  </bean>
> </beans>
> 
> Using this config the ignite server node starts as desired and the same
> holds for the inner http server. However no metrics are collected (Nothing
> is displayed on http://localhost:8080/), it seems as if
> prometheusStatsCollector is not successfully registering with the internally
> used default registry. Can someone see the issue with the above
> configuration? 
> 
> Thanks!
> 
> 
> 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/