I am deploying Jaeger using the Jaeger Operator and it seems to be working fine. However, now I am trying to set up Prometheus metrics scraping (using the Prometheus Operator) but I am not seeing a Service
in my cluster that exposes the metrics ports for the Jaeger Collector (port 14269) or Query services (port 16687) (port number reference from the Jeager Monitoring documentation).
The only relevant Service
I see is jaeger-operator-metrics
:
$ kubectl get svc -A
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
simple-prod-collector ClusterIP 10.43.20.131 <none> 9411/TCP,14250/TCP,14267/TCP,14268/TCP
simple-prod-query ClusterIP 10.43.141.211 <none> 16686/TCP
simple-prod-collector-headless ClusterIP None <none> 9411/TCP,14250/TCP,14267/TCP,14268/TCP
jaeger-operator-metrics ClusterIP 10.43.90.169 <none> 8383/TCP,8686/TCP
I am able to set up a Prometheus ServiceMonitor
to scrape metrics from this service but I am not sure if this includes the metrics that are normally gathered by the Collector and Query microservices or not... I am guessing not as that would seem to violate the premise of microservices.
Is there some setting in the Jaeger Operator spec that I missed for exposing those metrics endpoints in the other components?
I figured it out... the Jaeger Operator doesn't create a
Service
exposing the metrics endpoints. These endpoints are just exposed via the pods for the Collector and Query components.An example from the Collector pod spec:
Note the
admin-http
port there.So to get the Prometheus Operator to scrape these metrics, I created a
PodMonitor
which covers both the Collector and Query components because both of them have thelabels/app: jaeger
andadmin-http
ports defined: