Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-15360

mp.metrics.tags is not picked up when in microprofile-config.properties

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 24.0.0.Final
    • MP Metrics
    • None
    • Hide

      From the attached zip create a war file. I am using IntelliJ IDEA and started the server from the configuration and let it deploy the artifact. The only change to the configuration is to modify the startup script to pickup a different default configuration as following:

      standalone.bat -c standalone-microprofile.xml

      Now navigate to http://localhost:8080/test-artifact which should trigger the jax-rs test endpoint, produce a metric and give some output on the server console.

      Navigate to http://localhost:9990/metrics and look for keys starting with application_de_mygroup*. I expect them to have the global tags attached but they don't.

      A second test is to start over and change the startup configuration to include mp.metrics.tags as an environment variable. This is later visible in the metrics.

       

      Show
      From the attached zip create a war file. I am using IntelliJ IDEA and started the server from the configuration and let it deploy the artifact. The only change to the configuration is to modify the startup script to pickup a different default configuration as following: standalone.bat -c standalone-microprofile.xml Now navigate to http://localhost:8080/test-artifact which should trigger the jax-rs test endpoint, produce a metric and give some output on the server console. Navigate to http://localhost:9990/metrics and look for keys starting with application_de_mygroup*. I expect them to have the global tags attached but they don't. A second test is to start over and change the startup configuration to include mp.metrics.tags as an environment variable. This is later visible in the metrics.  

      We have a problem configuring the global tags for Microprofile Metrics when deploying a war Artifact. The key to set is specified as "mp.metrics.tags" and is not picked up from the microprofile-config.properties in the application. However, when using environment variables the value is picked up and is shown in the metrics visible under http://localhost:9990/metrics.

      As I was not sure if the Microprofile Spec allows this or not I checked against a Quarkus Applicaton which is also using smallrye-metrics and it worked. Either Quarkus enhanced the expected behaviour or Wildfly lacks something.

      Also, the testcode in the attached zip shows that the configuration value from the microprofile-config.properties is indeed visible to Microprofile Config but somehow does not arrive in the metrics.

            jaslee@redhat.com Jason Lee
            fanero Robert Kühne (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: