apisix-helm-chart icon indicating copy to clipboard operation
apisix-helm-chart copied to clipboard

feat: add serviceMonitor for apisix-gateway

Open mstefany opened this issue 1 year ago • 9 comments

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"

mstefany avatar Jan 17 '24 11:01 mstefany

Please, is it possible to have this reviewed and approved?

mstefany avatar Mar 05 '24 12:03 mstefany

ping @AlinsRan @Revolyssup

zll600 avatar Mar 06 '24 01:03 zll600

ping @AlinsRan @Revolyssup

zll600 avatar Mar 06 '24 01:03 zll600

Guys any feedback about the review ? We would like to enable the ingress controller monitoring ! :pray:

flassagn avatar Mar 18 '24 13:03 flassagn

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.

Revolyssup avatar Mar 18 '24 17:03 Revolyssup

I pushed the updated version, so that linter will be happy this time.

mstefany avatar Mar 20 '24 14:03 mstefany

Hi @Revolyssup, The PR needs two approval. Could you assign another maintainer here ? I really would like to scrape ingress controller metrics ! :pray:

flassagn avatar Apr 02 '24 06:04 flassagn

@AlinsRan @Revolyssup I updated the PR:

  • because both apisix-ingress-controller and apisix containers have ports named http, original ServiceMonitor would scrape both containers (if apisix-gateway is enabled), and cause error every 15 seconds, because there are no metrics on http port 9080 of gateway at /metrics URL. For this reason I am renaming http port of apisix-gateway-controller to http-controller.
  • enabling ServiceMonitor of gateway is now done separately in .Values.gateway.serviceMonitor, and it also provisions separate ServiceMonitor object 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.

mstefany avatar Apr 12 '24 17:04 mstefany

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

flassagn avatar Jul 02 '24 09:07 flassagn