You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we would like to scrape the application pod for its http prometheus metrics (on separate port because we use grpc) but if we add the extra port we get the error More than one container port is set: spec.template.spec.containers[0].ports Only a single port is allowed
Is there a way to expose application custom prometheus metrics?
Actual Behavior
Error when adding prometheus port More than one container port is set: spec.template.spec.containers[0].ports Only a single port is allowed
If you need something to work, then you can just expose (as in serve metrics on it) your second port and then add a manual k8s service with the same selector but looking at the 9092 port.
I can't quite tell - is issue 1411 meant to solve this problem? In my case, i'm not using kn monitoring, I simply want to grab the Prometheus metrics myself via our own components (ServiceMonitor) on its port (:8002/metrics).
I think our forward-looking guidance is that Knative isn't particularly doing anything "special" Kubernetes-wise, and metrics observation should be cluster-wide infrastructure (except that inbound scraping via Prometheus is a bit tricky, and users probably want to use the Prometheus push gateway or the OpenCensus Collector for application metrics).
Activity
vagababov commentedon May 23, 2020
If you need something to work, then you can just expose (as in serve metrics on it) your second port and then add a manual k8s service with the same selector but looking at the 9092 port.
nmnellis commentedon May 23, 2020
I want to scrape each pod individually but thanks for the workaround
jeffgriffith commentedon Jun 22, 2020
I can't quite tell - is issue 1411 meant to solve this problem? In my case, i'm not using kn monitoring, I simply want to grab the Prometheus metrics myself via our own components (ServiceMonitor) on its port (:8002/metrics).
mattmoor commentedon Aug 17, 2020
@evankanderson What is our forward-looking guidance here?
mattmoor commentedon Aug 17, 2020
Consolidating these under: #8471
evankanderson commentedon Aug 18, 2020
I think our forward-looking guidance is that Knative isn't particularly doing anything "special" Kubernetes-wise, and metrics observation should be cluster-wide infrastructure (except that inbound scraping via Prometheus is a bit tricky, and users probably want to use the Prometheus push gateway or the OpenCensus Collector for application metrics).