Skip to content

Repository files navigation

lra-coordinator-quarkus Project

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./mvnw compile quarkus:dev

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

OpenTelemetry and Metrics

This application is instrumented with OpenTelemetry and exposes metrics in Prometheus format.

Metrics Endpoint

Once the application is running, metrics are available at:

http://localhost:8080/q/metrics

For more information about the metrics provided by OpenTelemetry please visit https://github.com/quarkusio/quarkus/blob/main/docs/src/main/asciidoc/opentelemetry-metrics.adoc To expose custom LRA coordinator metrics it is possible to create a REST resource as described in the just mentioned Quarkus doc.

Example Usage

To view metrics in your browser or with curl:

curl http://localhost:8080/q/metrics

Integration with Prometheus

To scrape metrics with Prometheus, add the following job to your prometheus.yml:

scrape_configs:
  - job_name: 'lra-coordinator'
    metrics_path: '/q/metrics'
    static_configs:
      - targets: ['localhost:8080']

OpenTelemetry Configuration

The application is configured with:

  • Service name: lra-coordinator
  • Traces enabled: Yes
  • Metrics enabled: Yes

Additional OpenTelemetry configuration can be modified in src/main/resources/application.properties.

Grafana Dev Service (Optional)

For a fully integrated observability stack in dev mode (Grafana, Loki, Tempo, Prometheus), you can add the following dependency to your pom.xml:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-observability-devservices-lgtm</artifactId>
    <scope>provided</scope>
</dependency>

This will automatically start a Grafana LGTM container when running in dev mode, giving you access to a pre-configured Grafana dashboard to visualize metrics, logs, and traces.

Packaging and running the application

The application can be packaged using:

./mvnw package

It produces the quarkus-run.jar file in the target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.

The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar.

If you want to build an über-jar, execute the following command:

./mvnw package -Dquarkus.package.type=uber-jar

The application, packaged as an über-jar, is now runnable using java -jar target/*-runner.jar.

Creating a native executable

You can create a native executable using:

./mvnw package -Pnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

./mvnw package -Pnative -Dquarkus.native.container-build=true

You can then execute your native executable with: ./target/lra-coordinator-quarkus-1.0.0-SNAPSHOT-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

Provided Code

RESTEasy Reactive

Easily start your Reactive RESTful Web Services

Related guide section...

About

Quarkus based coordinator for Long Running Actions

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages