title: Micronaut Micrometer Prometheus common tag configuration is not applying to all metrics
body: <p>Spring Boot allows the declarative configuration of <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.metrics.customizing.common-tags" rel="nofollow noreferrer">common tags</a>:</p>
  <blockquote>
  <p>Commons tags are applied to all meters and can be configured, as the
  following example shows:</p>
  <pre><code>management.metrics.tags.region=us-east-1
  </code></pre>
  </blockquote>
  <p>Thus, in Spring Boot, with <code>management.metrics.tags.application=myapp</code> in place, all metrics include that tag, e.g.:</p>
  <pre><code>jvm_memory_max_bytes{application=&quot;myapp&quot;,area=&quot;heap&quot;,id=&quot;G1 Survivor Space&quot;} -1.0
  system_cpu_count{application=&quot;myapp&quot;} 16.0
  </code></pre>
  <p>I want to achieve the same in a Micronaut application. There doesn't seem to be a declarative way to do it and instead, we need to <a href="https://micronaut-projects.github.io/micronaut-micrometer/latest/guide/#metricsConcepts" rel="nofollow noreferrer">programatically customize</a> it using a <code>MeterRegistryConfigurer</code>.</p>
  <p>I created the following:</p>
  <pre><code>@Singleton
  @RequiresMetrics
  class PrometheusMeterRegistryConfigurer: MeterRegistryConfigurer&lt;MeterRegistry&gt; {
  
      override fun configure(meterRegistry: MeterRegistry) {
          meterRegistry.config().commonTags(&quot;application&quot;, &quot;myapp&quot;)
      }
  
      override fun getType(): Class&lt;MeterRegistry&gt; {
          return MeterRegistry::class.java
      }
  }
  </code></pre>
  <p>The problem is it isn't applying it to all metrics, some metrics are tagged (<code>http_server_requests_seconds_max</code>) while other aren't (<code>jvm_memory_max_bytes</code>, <code>system_cpu_count</code>, etc.):</p>
  <pre><code>http_server_requests_seconds_max{application=&quot;myapp&quot;,exception=&quot;none&quot;,method=&quot;GET&quot;,status=&quot;200&quot;,uri=&quot;/actuator/prometheus&quot;,} 0.131942121
  jvm_memory_max_bytes{area=&quot;nonheap&quot;,id=&quot;CodeHeap 'profiled nmethods'&quot;,} 1.22023936E8
  system_cpu_count 16.0
  </code></pre>
  <p>How can I make the tag apply to all micrometer-prometheus metrics?</p>