Open ratheesh001 opened 7 years ago
The best way would be to programmatically track the metrics in stagemonitor's metric registry: https://github.com/stagemonitor/stagemonitor/wiki/Track-your-own-metrics#programmatic
Then you can create a custom kibana dashboard for your metrics.
Thanks felix for quick response. I am already having few params that is exposed over JMX. Can this data be periodically send to elastic?
You can use this code to register a gauge to the metric registry which pulls metrics from jmx:
public class MBeanGauge<T> implements Gauge<T> {
private final ObjectInstance objectInstance;
private MBeanGauge(String objectName) {
this.objectInstance = MBeanUtils.queryMBeans(objectName).iterator().next();
}
@Override
public T getValue() {
return (T) MBeanUtils.getValueFromMBean(objectInstance, "Count");
}
}
In my tomcat application, I have few params like db connections( used/free), and some other custom stats that is being logged into log files. What is the best way to get these stats into elastic search and view in kibana dashborad using stage monitor. By adding the configuration stagemonitor.reporting.elasticsearch.onlyLogElasticsearchMetricReports=true, will I be able to see the data that is periodically send to elastic in the log files.