You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "llowinge (via GitHub)" <gi...@apache.org> on 2023/06/30 10:44:11 UTC

[GitHub] [camel-quarkus-examples] llowinge opened a new pull request, #151: Add Micrometer features to Observability example

llowinge opened a new pull request, #151:
URL: https://github.com/apache/camel-quarkus-examples/pull/151

   Note that the `main` branch points at the latest stable Camel Quarkus release.
   Pull requests should be generally send against the `camel-quarkus-main` branch pointing at the current Camel Quarkus SNAPSHOT.


-- 
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


[GitHub] [camel-quarkus-examples] orpiske commented on a diff in pull request #151: Add Micrometer features to Observability example

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #151:
URL: https://github.com/apache/camel-quarkus-examples/pull/151#discussion_r1247798446


##########
observability/README.adoc:
##########
@@ -19,18 +19,88 @@ workspace. Any modifications in your project will automatically take effect in t
 TIP: Please refer to the Development mode section of
 https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
 
+=== How to enable metrics
+To enable observability features in Camel, we need to add some additional dependencies to the project's pom.xml file.

Review Comment:
   Also, here, use Camel Quarkus. I think it's better to avoid confusion (it's a bit different to enable that on Camel Core). 



-- 
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


[GitHub] [camel-quarkus-examples] jamesnetherton merged pull request #151: Add Micrometer features to Observability example

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton merged PR #151:
URL: https://github.com/apache/camel-quarkus-examples/pull/151


-- 
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


[GitHub] [camel-quarkus-examples] llowinge commented on pull request #151: Add Micrometer features to Observability example

Posted by "llowinge (via GitHub)" <gi...@apache.org>.
llowinge commented on PR #151:
URL: https://github.com/apache/camel-quarkus-examples/pull/151#issuecomment-1614525265

   @orpiske Would you like to review as well ? Thank you


-- 
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


[GitHub] [camel-quarkus-examples] orpiske commented on a diff in pull request #151: Add Micrometer features to Observability example

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #151:
URL: https://github.com/apache/camel-quarkus-examples/pull/151#discussion_r1247795900


##########
observability/README.adoc:
##########
@@ -19,18 +19,88 @@ workspace. Any modifications in your project will automatically take effect in t
 TIP: Please refer to the Development mode section of
 https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
 
+=== How to enable metrics
+To enable observability features in Camel, we need to add some additional dependencies to the project's pom.xml file.
+The most important one (see link:pom.xml#L97-L100[pom.xml]):
+
+[source, xml]
+----
+<dependency>
+    <groupId>org.apache.camel.quarkus</groupId>
+    <artifactId>camel-quarkus-micrometer</artifactId>
+</dependency>
+----
+
+After adding this dependency, you can benefit from both https://camel.apache.org/components/3.20.x/micrometer-component.html[Camel Micrometer] and https://quarkus.io/guides/micrometer[Quarkus Micrometer] worlds.
+We are able to use multiple ways how to achieve create meters for our custom metrics.
+
+First of them is using Camel micrometer component (see link:src/main/java/org/acme/observability/Routes.java[Routes.java]):
+
+[source, java]
+----
+.to("micrometer:counter:org.acme.observability.greeting-provider?tags=type=events,purpose=example")
+----
+
+which will count each call to `platform-http:/greeting-provider` endpoint.
+
+Second approach is to benefit from auto-injected `MeterRegistry` (see link:src/main/java/org/acme/observability/Routes.java#L28[injection]) and use it directly (see link:src/main/java/org/acme/observability/Routes.java#L36[registry call]):
+
+[source, java]
+----
+registry.counter("org.acme.observability.greeting", "type", "events", "purpose", "example").increment();
+----
+
+which will count each call to `from("platform-http:/greeting")` endpoint.
+
+Finally last approach is to use Micrometer annotations (see https://quarkus.io/guides/micrometer#does-micrometer-support-annotations[which] are supported by Quarkus) by defining bean link:src/main/java/org/acme/observability/micrometer/TimerCounter.java[TimerCounter.java] as follows:
+
+[source, java]
+----
+@ApplicationScoped
+@Named("timerCounter")
+public class TimerCounter {
+
+    @Counted(value = "org.acme.observability.timer-counter", extraTags = { "purpose", "example" })
+    public void count() {
+    }
+}
+----
+
+and invoking it from Camel via (see link:src/main/java/org/acme/observability/TimerRoute.java[TimerRoute.java]):
+
+[source, java]
+----
+.bean("timerCounter", "count")
+----
+It will count each timer fire.

Review Comment:
   Maybe you can rephrase it as: "It will count each time the timer is fired?"  



-- 
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


[GitHub] [camel-quarkus-examples] jamesnetherton commented on a diff in pull request #151: Add Micrometer features to Observability example

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on code in PR #151:
URL: https://github.com/apache/camel-quarkus-examples/pull/151#discussion_r1247788002


##########
observability/README.adoc:
##########
@@ -19,18 +19,88 @@ workspace. Any modifications in your project will automatically take effect in t
 TIP: Please refer to the Development mode section of
 https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
 
+=== How to enable metrics
+To enable observability features in Camel, we need to add some additional dependencies to the project's pom.xml file.
+The most important one (see link:pom.xml#L97-L100[pom.xml]):
+
+[source, xml]
+----
+<dependency>
+    <groupId>org.apache.camel.quarkus</groupId>
+    <artifactId>camel-quarkus-micrometer</artifactId>
+</dependency>
+----
+
+After adding this dependency, you can benefit from both https://camel.apache.org/components/3.20.x/micrometer-component.html[Camel Micrometer] and https://quarkus.io/guides/micrometer[Quarkus Micrometer] worlds.
+We are able to use multiple ways how to achieve create meters for our custom metrics.

Review Comment:
   ```suggestion
   We are able to use multiple ways to create meters for our custom metrics.
   ```



##########
observability/README.adoc:
##########
@@ -19,18 +19,88 @@ workspace. Any modifications in your project will automatically take effect in t
 TIP: Please refer to the Development mode section of
 https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
 
+=== How to enable metrics
+To enable observability features in Camel, we need to add some additional dependencies to the project's pom.xml file.
+The most important one (see link:pom.xml#L97-L100[pom.xml]):
+
+[source, xml]
+----
+<dependency>
+    <groupId>org.apache.camel.quarkus</groupId>
+    <artifactId>camel-quarkus-micrometer</artifactId>
+</dependency>
+----
+
+After adding this dependency, you can benefit from both https://camel.apache.org/components/3.20.x/micrometer-component.html[Camel Micrometer] and https://quarkus.io/guides/micrometer[Quarkus Micrometer] worlds.

Review Comment:
   ```suggestion
   After adding this dependency, you can benefit from both https://camel.apache.org/components/next/micrometer-component.html[Camel Micrometer] and https://quarkus.io/guides/micrometer[Quarkus Micrometer] worlds.
   ```



-- 
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