Publishing WSO2 API Manager Analytics to an On-Premise ELK stack in a Kubernetes-based deployment


An organization running an API Management platform often needs to look for statistics that would reveal insights into how the APIs deployed on the platform are consumed by the clients. It also provides essential statistics such as which devices and applications are using the statistics as well as whether the APIs are delivering successful responses to the clients or causing errors due to various reasons. Additionally, understanding the latency of an API is also of utmost importance to the administrators of the platform to determine whether the response times are within the SLAs agreed upon with the clients.


ELK-Based analytics architecture
Share analytics logs using volumes


Implementation involves configuring a volume to share the analytics log file between API Manager container and the Filebeat container and deploying filebeat as a sidecar.

apiVersion: v1kind: ConfigMapmetadata:name: filebeat-confignamespace: wso2labels:k8s-app: filebeatdata:filebeat.yml: |-filebeat.inputs:- type: logenabled: truepaths:- /home/wso2carbon/wso2am-4.0.0/repository/logs/apim_metrics.loginclude_lines: ['(apimMetrics):']output.logstash:hosts: [""]
volumes:- name: wso2am-metricsemptyDir: {}- name: filebeat-configconfigMap:name: filebeat-configitems:- key: filebeat.ymlpath: filebeat.yml
- name: filebeatimage: name: wso2am-metricsmountPath: /home/wso2carbon/wso2am-4.0.0/repository/logs- name: filebeat-configmountPath: /usr/share/filebeat/filebeat.ymlsubPath: filebeat.yml
volumeMounts:- name: wso2am-metricsmountPath: /home/wso2carbon/wso2am-4.0.0/repository/logs





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store