Skip to content

pingsource-mt-adapter declares metrics port 9090 but serves metrics on 9092 #9609

Open

Description

@RajPrakash681

Describe the bug
The pingsource-mt-adapter Deployment names container port 9090 metrics, but the adapter serves Prometheus metrics on 9092. A PodMonitor or scrape config that uses the metrics port gets connection refused.

Expected behavior
The port named metrics is the port the adapter serves metrics on.

To Reproduce
Set metrics-protocol: prometheus in config-observability and create any PingSource (the adapter has 0 replicas until one exists; if it is already running, restart it, since it reads config-observability only at startup). Then:

kubectl -n knative-eventing get deploy pingsource-mt-adapter \
  -o jsonpath='{.spec.template.spec.containers[0].ports}'
kubectl -n knative-eventing port-forward deploy/pingsource-mt-adapter 9090 9092 &
sleep 2
curl -s -o /dev/null -w '%{http_code}\n' localhost:9092/metrics   # 200
curl -s -o /dev/null -w '%{http_code}\n' localhost:9090/metrics   # 000; port-forward logs "connection refused" and exits

With the Prometheus Operator, this PodMonitor shows the target as down with dial tcp <pod-ip>:9090: connect: connection refused:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: pingsource-mt-adapter
  namespace: knative-eventing
spec:
  selector:
    matchLabels:
      eventing.knative.dev/source: ping-source-controller
      sources.knative.dev/role: adapter
  podMetricsEndpoints:
  - port: metrics

Knative release version
1.24.0, and main. The mismatch started in 1.19.1 and 1.20.0. In 1.18 the adapter served on 9090.

Additional context
The other components that serve on 9092 (mt-broker-ingress, mt-broker-filter, job-sink, the ApiServerSource adapter) already declare 9092. The same mismatch was reported in 2022 (#6509) and fixed then by serving on 9090 (#6615).

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions