Skip to content

Metrics endpoint is not exposed by Service #61

Closed
@alex1989hu

Description

@alex1989hu
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.

Activity

added a commit that references this issue on Nov 19, 2021
4374bce
added 2 commits that reference this issue on Nov 25, 2021
ed6768f
a7ab9ae
added a commit that references this issue on Dec 7, 2021
b1afa50
jkatz

jkatz commented on Dec 20, 2021

@jkatz
Contributor

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

alex1989hu

alex1989hu commented on Dec 21, 2021

@alex1989hu
ContributorAuthor

@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

added a commit that references this issue on Oct 17, 2022
10a4d8b
benjaminjb

benjaminjb commented on Oct 18, 2022

@benjaminjb
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

genofire commented on Feb 17, 2023

@genofire

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

jcpunk commented on Apr 24, 2023

@jcpunk

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

benjaminjb

benjaminjb commented on May 2, 2025

@benjaminjb
Contributor

Hello, just to let you know, the most recent release includes

  • operator metrics rerouted to 8443 (cite)
  • installers expose that port (cite)
  • and our monitoring stack has a scrape job focused on that (cite)

There's no service, but then there's no service for our other metrics: we just use Prometheus scrape jobs.

It seems to me that the situation fits the request. Given that, I'm going to close this issue, BUT if you think there's more to talk about, please reopen this ticket and let's talk about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @jkatz@jcpunk@benjaminjb@genofire@alex1989hu

      Issue actions

        Metrics endpoint is not exposed by Service · Issue #61 · CrunchyData/postgres-operator-examples