Search code examples
wso2prometheusmonitoringwso2-api-manager

How to gather WSO2AM metrics in prometheus?


I have wso2am 4.1 deployed on k8s cluster and I want to scarp metrics from it using prometheus to develope grafana dashboard.

I am unable to find any reliable way to expose metrics in wso2am, and documentation provided by dev's isn't satisfactory. I've found some tutorial but it's designed for wso2am 3.2 and dosen't work on my 4.1 version. Also I've found different methods on internet but they are contardicting eachother, for example one says to:

modify <WSO2AM_HOME>/repository/conf/deployment.toml
[metrics]
enabled = true
port = 9090

another says to add this line below previous (but firstinstruction didn't said anything about that):

[metrics.prometheus]
enabled = true

Next one dosen't say anything about deployment.toml, but says that i need to modify

 <WSO2AM_HOME>//repository/conf/metrics/prometheus/metrics.xml

and add:

<reporter name="prometheus" class="org.wso2.carbon.metrics.prometheus.reporter.PrometheusReporter">
        <property name="port" value="9090"/>
        <property name="scrapeInterval" value="10"/>
        <property name="timeUnit" value="SECONDS"/>
    </reporter>

I tried this but no one is working for me, and at this point I am not sure if all of them are wrong, i need to combine them, or I've made mistake somewhere. Is there any proved tutorial how to enable basic metrics to be accessible by prometheus?


Solution

  • You can get the JMX stats from prometheus for WSO2 API Manager. Please check the blog article - https://lashan.medium.com/monitoring-wso2-products-with-prometheus-4ace34759901

    Apart from these JMX stats, there are no other direct integrations with WSO2 API Manager and Prometheus.