Chapter 2. Exposing metrics in your Quarkus applications


Enable metrics in Quarkus 1.11 using the micrometer extension. After you enable it, real-time values of all metrics collected by the micrometer extension are viewed using the /q/metrics endpoint. By default, this endpoint only responds in plain text.

Procedure

  1. Add the quarkus-micrometer-registry-prometheus extension as a dependency to your application:

    ./mvnw quarkus:add-extension -Dextensions="io.quarkus:quarkus-micrometer-registry-prometheus"
    Copy to Clipboard Toggle word wrap

    This command adds the following dependency to your pom.xml:

    pom.xml

    <dependency>
          <groupId>io.quarkus</groupId>
        <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
    </dependency>
    Copy to Clipboard Toggle word wrap

  2. Enter the following command to display collected metrics on your terminal:

    curl http://localhost:8080/q/metrics
    Copy to Clipboard Toggle word wrap
  3. (Optional) To enable the collection of metrics in JSON format using the Micrometer extension, add the following line to the src/main/resources/application.properties file:

    quarkus.micrometer.export.json.enabled=true
    Copy to Clipboard Toggle word wrap
  4. Save the changes to the application.properties file.
  5. Use the following command to view metrics in JSON format:

    curl -i -H "Accept: application/json" -H "Content-Type: application/json"
    http://localhost:8080/q/metrics
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top