apisix-helm-chart
apisix-helm-chart copied to clipboard
feat: add serviceMonitor for apisix-gateway
Metrics' port & URL is defined here (port 9091 & URL /apisix/prometheus/metrics).
And it doesn't match what's in the serviceMonitor. TargetPort should be prometheus, a.k.a. 9091, and path is not specified which defaults to /metrics which is incorrect.
Fact that it's not working in default configuration is visible in my logs:
apisix-ingress-controller-6b4d5cc778-f582v apisix 10.254.82.207 - - [17/Jan/2024:11:00:22 +0000] 10.254.83.238:9080 "GET /metrics HTTP/1.1" 404 47 0.000 "-" "Prometheus/2.48.1" - - - "http://10.254.83.238:9080"
Please, is it possible to have this reviewed and approved?
ping @AlinsRan @Revolyssup
ping @AlinsRan @Revolyssup
Guys any feedback about the review ? We would like to enable the ingress controller monitoring ! :pray:
Guys any feedback about the review ? We would like to enable the ingress controller monitoring ! 🙏
I will take a look at this tomorrow and review. Thanks for reminding.
I pushed the updated version, so that linter will be happy this time.
Hi @Revolyssup, The PR needs two approval. Could you assign another maintainer here ? I really would like to scrape ingress controller metrics ! :pray:
@AlinsRan @Revolyssup I updated the PR:
- because both
apisix-ingress-controllerandapisixcontainers have ports namedhttp, originalServiceMonitorwould scrape both containers (ifapisix-gatewayis enabled), and cause error every 15 seconds, because there are no metrics on http port 9080 of gateway at/metricsURL. For this reason I am renaminghttpport ofapisix-gateway-controllertohttp-controller. - enabling
ServiceMonitorof gateway is now done separately in.Values.gateway.serviceMonitor, and it also provisions separateServiceMonitorobject to scrape such metrics
Please, review the code if this approach is acceptable. I have updated README.md with helm-docs so there shouldn't be linter errors.
Hi Guys,
@AlinsRan @Revolyssup could you review the PR shared by @mstefany ? :pray:
Thank you for your time and I wish you a good day