You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/04/05 18:35:56 UTC

[GitHub] [camel-k] SubhasmitaSw commented on a diff in pull request #3152: Example to show usage of prometheus trait

SubhasmitaSw commented on code in PR #3152:
URL: https://github.com/apache/camel-k/pull/3152#discussion_r843144135


##########
examples/traits/prometheus/README.md:
##########
@@ -0,0 +1,27 @@
+# Camel K Prometheus Trait
+
+In this section you will find examples about fine tuning your `Integration` using **Prometheus** `trait` capability.
+
+Run the integration via:
+
+    $ kamel run -t prometheus.enabled=true Hello.java
+
+A Prometheus-compatible endpoint is configured with the Prometheus trait. When utilising the Prometheus operator, it also generates a PodMonitor resource, which allows the endpoint to be scraped automatically.
+
+
+To get statistics about the number of events successfully handled by the `Integration`,execute the `MyIntegration.java` route individually via:
+
+    $ kamel run -t prometheus.enabled=true MyIntegration.java
+
+You should be able to see the new integration running after a while via:
+
+    $ kamel get 
+
+The metrics can be retrieved by port-forwarding this service, e.g.:
+
+    $ kubectl port-forward svc/metrics-prometheus 8080:8080
+
+    $ curl http://localhost:8080/metrics
+
+Similarly other use cases can be to retrieve information on unprocessed events, number of retries made to process an event, etc. For more information on Integration monitoring refer to the [Camel K Integration Monitoring](https://camel.apache.org/camel-k/1.8.x/observability/monitoring/integration.html) documentation.

Review Comment:
   Done!



-- 
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-unsubscribe@camel.apache.org

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