postgres-operator-examples icon indicating copy to clipboard operation
postgres-operator-examples copied to clipboard

Metrics endpoint is not exposed by Service

Open alex1989hu opened this issue 4 years ago • 5 comments

I found during Postgres Operator startup that the metrics server is binded to 8080 port but unfortunately it is not exposed by k8s Service.

Actual log line:

time="2021-11-19T12:44:10Z" level=info msg="metrics server is starting to listen" addr=":8080" file="sigs.k8s.io/[email protected]/pkg/log/deleg.go:130" func="log.(*DelegatingLogger).Info" version=5.0.3-0

Prometheus metrics are available at :8080/metrics URL.

alex1989hu avatar Nov 19 '21 12:11 alex1989hu

@alex1989hu These are controller metrics -- is there anything specific you are looking to collect?

jkatz avatar Dec 20 '21 22:12 jkatz

@alex1989hu These are controller metrics -- is there anything specific you are looking to collect?

For now, there are no specific metrics but it is enabled in PGO. Did not check PGO source code whether we set additional metrics or not.

Propose to expose it (see PR) or disable metrics endpoint in PGO

alex1989hu avatar Dec 21 '21 08:12 alex1989hu

Hey Alex, just wanted to let you know that I've added this (and the related PR) to our backlog to make a decision on whether we want to expose those metrics or disable them by default.

benjaminjb avatar Oct 18 '22 19:10 benjaminjb

you should also add Manifests (Pod or ServiceMonitor) for Prometheus-Operator (like in #94 ) for the Operator to scrape that metrics.

And maybe PrometheusRules with a default set of AlertingRules.

genofire avatar Feb 17 '23 16:02 genofire

I'll confess I'd love to see this in the helm and kustomize examples...

jcpunk avatar Apr 24 '23 17:04 jcpunk