Skip to content
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

Metrics endpoint is not exposed by Service #61

Open
alex1989hu opened this issue Nov 19, 2021 · 5 comments · May be fixed by #62
Open

Metrics endpoint is not exposed by Service #61

alex1989hu opened this issue Nov 19, 2021 · 5 comments · May be fixed by #62
Labels

Comments

@alex1989hu
Copy link
Contributor

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/controller-runtime@v0.8.3/pkg/log/deleg.go:130" func="log.(*DelegatingLogger).Info" version=5.0.3-0

Prometheus metrics are available at :8080/metrics URL.

alex1989hu added a commit to alex1989hu/postgres-operator-examples that referenced this issue Nov 19, 2021
To let us able to scrape metrics from the Operator
e.g. with a ServiceMonitor we need to have a Service
which provides named port

close CrunchyData#61

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
@alex1989hu alex1989hu linked a pull request Nov 19, 2021 that will close this issue
alex1989hu added a commit to alex1989hu/postgres-operator-examples that referenced this issue Nov 25, 2021
To let us able to scrape metrics from the Operator
e.g. with a ServiceMonitor we need to have a Service
which provides named port

close CrunchyData#61

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
alex1989hu added a commit to alex1989hu/postgres-operator-examples that referenced this issue Nov 25, 2021
To let us able to scrape metrics from the Operator
e.g. with a ServiceMonitor we need to have a Service
which provides named port

close CrunchyData#61

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
alex1989hu added a commit to alex1989hu/postgres-operator-examples that referenced this issue Dec 7, 2021
To let us able to scrape metrics from the Operator
e.g. with a ServiceMonitor we need to have a Service
which provides named port

close CrunchyData#61

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
@jkatz
Copy link
Contributor

jkatz commented Dec 20, 2021

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

@alex1989hu
Copy link
Contributor Author

@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 added a commit to alex1989hu/postgres-operator-examples that referenced this issue Oct 17, 2022
To let us able to scrape metrics from the Operator
e.g. with a ServiceMonitor we need to have a Service
which provides named port

close CrunchyData#61

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
@benjaminjb
Copy link
Contributor

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.

@genofire
Copy link

genofire commented Feb 17, 2023

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.

@jcpunk
Copy link

jcpunk commented Apr 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants