Hello, Kamlesh!

Thanks for trying out open census integration.
You can find self-explained example in Ignite sources [1].

To integrate with prometheus you have:

1. Enable `ignite-opencensus`.
2. Configure opencensus exporter in IgniteConfiguration:

```
        OpenCensusMetricExporterSpi openCensusMetricExporterSpi = new 
OpenCensusMetricExporterSpi();

        // Metrics written to the collector each 1 second.
        openCensusMetricExporterSpi.setPeriod(PERIOD);

        cfg.setMetricExporterSpi(openCensusMetricExporterSpi);
```

3. Enable opencensus http server(after it you can view metrics values with the 
http://HOST:PORT/ URL):

```
        // Setting up prometheus stats collector.
        PrometheusStatsCollector.createAndRegister();

        // Setting up HTTP server that would serve http://localhost:8080 
requests.
        HTTPServer srv = new HTTPServer(HOST, PORT, true);
```

4. Grab metrics values in the prometheus:

prometheus.yml

```
scrape_configs:
  - job_name: ‘ignite'
    static_configs:
      - targets: [‘localhost:8080’] # - same host and port as at step 3.
``` 

[1] 
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/opencensus/OpenCensusMetricsExporterExample.java

> 25 марта 2020 г., в 12:01, Kamlesh Joshi <[email protected]> написал(а):
> 
> Thanks for the update Anton. 
>  
> Have some queries as below:
> 1.       How do we feed the Ignite cluster data which is exposed on JMX port 
> to custom exporter given on 
> (https://opencensus.io/exporters/supported-exporters/java/prometheus/) ?
> 2.       If we move opencensus lib to $IGNITE_HOME/libs/ will it be exposed 
> on some default port (likewise ignite-rest)? How does exactly opencensus will 
> affect the cluster?
>  
> Thanks and Regards,
> Kamlesh Joshi
>  
> -----Original Message-----
> From: akurbanov <[email protected]> 
> Sent: 24 March 2020 19:28
> To: [email protected]
> Subject: [External]Re: Exporter usage of Ignite 2.8.0
>  
> The e-mail below is from an external source. Please do not open attachments 
> or click links from an unknown or suspicious origin.
>  
> Hello,
>  
> Unfortunately, the documentation is not available yet on the website, but you 
> can use org.apache.ignite.spi.metric.opencensus.OpenCensusMetricExporterSpi 
> that comes with ignite-opencensus in distribution:
> $IGNITE_HOME/libs/optional/ignite-opencensus. 
>  
> The metric exporter should be registered in IgniteConfiguration, please see 
> the Java example:
> https://github.com/nizhikov/ignite/blob/b362cfad309ec8f31c6cba172391c74589c9191f/modules/opencensus/src/test/java/org/apache/ignite/internal/processors/monitoring/opencensus/OpenCensusMetricExporterSpiTest.java
>  
> Prometeus:
> https://opencensus.io/exporters/supported-exporters/java/prometheus/
> Documentation waiting list:
> http://apache-ignite-developers.2346864.n4.nabble.com/Ignite-2-8-documentation-td46008.html
> IEP 35:
> https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=112820392&src=sidebar
>  
> Best regards,
> Anton
>  
>  
>  
>  
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>  
> 
> "Confidentiality Warning: This message and any attachments are intended only 
> for the use of the intended recipient(s), are confidential and may be 
> privileged. If you are not the intended recipient, you are hereby notified 
> that any review, re-transmission, conversion to hard copy, copying, 
> circulation or other use of this message and any attachments is strictly 
> prohibited. If you are not the intended recipient, please notify the sender 
> immediately by return email and delete this message and any attachments from 
> your system.
> 
> Virus Warning: Although the company has taken reasonable precautions to 
> ensure no viruses are present in this email. The company cannot accept 
> responsibility for any loss or damage arising from the use of this email or 
> attachment."
> 

Reply via email to