Can I know how to enable WSO2 carbon metrics in a Siddhi extension when running a test case written for the extension? Currently, when running a test case, metrics are not returned.
Need to know how to make below conditions true
if (MetricsDataHolder.getInstance().getMetricService() != null
&& MetricsDataHolder.getInstance().getMetricManagementService().isEnabled()) {
try {
if (MetricsDataHolder.getInstance().getMetricManagementService()
.isReporterRunning(SourceConstants.PROMETHEUS_REPORTER_NAME)) {
You can follow this[1] documentation to enable matrics in the Streaming integrator, this enables reporting capability on all the supported extensions.
If you only need to save metrics into a database, then add the following configuration to the deployment.yaml file
[1] https://apim.docs.wso2.com/en/4.0.0/observe/streaming-integrator/setting-up-si-statistics-dashboards/