-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/prometheus #3547
Feat/prometheus #3547
Conversation
Prometheus plugin needs a dedicated shm to store metrics of Kong and it's upstream. This patch sets the injects the requried shm into NGINX template if the plugin is available for use. The size chosen for the shm is 5 MB, which is more than sufficient to store metrics related to a few hundred services (tested for upto 200 services). This is a temporary workaround until there is an API exposed from the core which allows specifying custom shared dicts for plugin. When such an API is introduced, the changes introduced by commit should be reverted.
|
||
if shm_value then | ||
if not string.match(shm_value, "prometheus_metrics") then | ||
shm_value = shm_value .. "; lua_shared_dict prometheus_metrics 5m" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is making me regret that the loop injected in the template is not iterating over an array, which would be future proof, would not make this hack necessary, and would yield predictable results if we ever do or allow some sorting of the directives...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, good point since this the directive injection can be used as frequent internally in the code as an end user would want to do it via kong.conf
.
Plugin source code located at: https://github.com/Kong/kong-plugin-prometheus From #3547
Prometheus plugin needs a dedicated shm to store metrics of Kong and it's upstream. This patch sets the injects the requried shm into NGINX template if the plugin is available for use. The size chosen for the shm is 5 MB, which is more than sufficient to store metrics related to a few hundred services (tested for upto 200 services). This is a temporary workaround until there is an API exposed from the core which allows specifying custom shared dicts for plugin. When such an API is introduced, the changes introduced by commit should be reverted. From #3547
Merged! Thank you |
No description provided.