Company
Date Published
Author
Jun Ouyang
Word count
690
Language
English
Hacker News points
None

Summary

Kong's API Gateway offers critical observability options through Prometheus, an open-source monitoring toolkit, and StatsD, a metric aggregation tool originally developed by Etsy. Prometheus can pull metrics directly from Kong Gateway or use a StatsD exporter to reduce the gateway's workload. Built on OpenResty/Nginx, Kong Gateway utilizes a multi-process, single-threaded architecture that can experience performance issues, such as increased latencies, when the Prometheus plugin with high cardinality metrics is used due to the need for mutex locks on shared memory. To mitigate this, Kong Gateway 3.0 has changed its default settings to not export certain metrics to avoid overhead, although these can be manually enabled if needed. The StatsD plugin is recommended for scenarios with high metric cardinality as it pushes metrics without storing them in memory, thus having minimal impact on performance. In Kong 3.0, advanced StatsD functions have been moved to the StatsD plugin, allowing community users to access previously enterprise-only features, while the StatsD exporter can be deployed as a sidecar for horizontal scaling, avoiding bottlenecks.