This example shows how to use Camel with Micrometer Observation to create observations for incoming and outgoing Camel messages.
For Metrics we are using Micrometer Core, for Tracing we’re using Micrometer Tracing with OpenTelemetry.
The example includes four sub maven modules that implement
-
client
-
service1
-
service2
-
loggingtracer
Where client → service1 → service2 using HTTP.
Then using three different shells and run service1 and service2 before the client. These services use an annotation CamelObservation to indicate that the service should be traced.
$ java -jar service1/target/*.jar
When service1 is ready then start service2
$ java -jar service2/target/*.jar
And then start the client that calls service1 every 30 seconds.
$ java -jar client/target/*.jar
The client application explicitly instantiates and initializes the Micrometer Observation Tracer with the CamelContext.
The shells will show OBSERVATION EVENT messages indicating what event have been observed.
Running the docker containers using docker compose it is possible to access to Prometheus, Jaeger and Grafana
$ cd containers
$ docker-compose up
Jaeger: http://localhost:16686/
Prometheus: http://localhost:9090/
Grafana: http://localhost:3000/
Refer to dedicated guide
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!