Support wider range of monitored environments with Prometheus
Presently the Prometheus search queries, in an effort to avoid polluting an app's metrics by including POD system services, specifically only include metrics where container_name="app"
.
Current query example:
(sum(container_memory_usage_bytes{container_name="app",environment="$CI_ENVIRONMENT_SLUG"}) / count(container_memory_usage_bytes{container_name="app",environment="$CI_ENVIRONMENT_SLUG"})) /1024/1024
We should instead specifically exclude POD system services by specifying container_name~="POD"
, which is a cleaner way to do this.
New query example:
(sum(container_memory_usage_bytes{container_name!="POD",environment="#{environment_slug}"}) / count(container_memory_usage_bytes{container_name!="POD",environment="#{environment_slug}"})) /1024/1024