k0pper commented on issue #3027:
URL: https://github.com/apache/camel-k/issues/3027#issuecomment-1048583055


   Thank you, not having the Prometheus Operator installed was the issue. For 
everyone dealing with the same problem, here are steps to install Prometheus 
with the Operator on minikube and being able to see camel k- and camel related 
metrics:
   
   1. I installed all CRDs via the 
[kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) 
repository. I followed the instruction how to install on 
https://github.com/prometheus-operator/kube-prometheus.git
   
   
   2. I installed Prometheus Operator
   ```
   cat <<EOF | kubectl apply -f -
   apiVersion: monitoring.coreos.com/v1
   kind: Prometheus
   metadata:
     name: prometheus
     namespace: monitoring
   spec:
     podMonitorSelector:
       matchExpressions:
         - key: camel.apache.org/integration
           operator: Exists
   EOF
   ```
   
   
   3. I created the PodMonitor resource to be able to have metrics about the 
camel k operator and some basic prometheus rules
   ```
   # PodMonitor for Opeartor Metrics
   kubectl apply -f 
https://raw.githubusercontent.com/apache/camel-k/main/config/prometheus/operator-pod-monitor.yaml
 --namespace monitoring
   
   # Operator Prometheus Rules
   kubectl apply -f 
https://raw.githubusercontent.com/apache/camel-k/main/config/prometheus/operator-prometheus-rule.yaml
 --namespace monitoring
   ```
   
   
   Done. Everytime I deploy an integration (doesnt matter how, DSL, yaml 
routes, KameletBindings ...), the Prometheus Operator creates a PodMonitor 
resource for the particular Pod and after around 1 minute after the integration 
is deployed, I see camel related metrics for the Pods:
   
   <img width="1148" alt="Bildschirmfoto 2022-02-23 um 10 18 27" 
src="https://user-images.githubusercontent.com/29041421/155290738-50a17b9b-2dcf-4e80-a86b-919e6085db9a.png";>
   
   Key Lesson: PodMonitor resources get for the integration are necessary to 
have metrics in Prometheus. And when the Prometheus Operator is missing theyre 
not getting created thus not exposing metrics.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to