<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HikariCP JMX – Unable to split Pool metrics by pool name when multiple pools exist in the same JVM in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/HikariCP-JMX-Unable-to-split-Pool-metrics-by-pool-name-when/m-p/299002#M7249</link>
    <description>&lt;DIV&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m working with &lt;STRONG&gt;Dynatrace Managed on prem&lt;/STRONG&gt; and a &lt;STRONG&gt;custom JMX extension&lt;/STRONG&gt; to collect &lt;STRONG&gt;HikariCP metrics&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I can successfully collect metrics from both:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;com.zaxxer.hikari:type=PoolConfig&lt;/LI&gt;&lt;LI&gt;com.zaxxer.hikari:type=Pool&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is however an important difference between the two:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;PoolConfig&lt;/STRONG&gt; exposes a PoolName attribute → I can define a dimension (e.g. pool.name) and split metrics per pool&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mouadrhm_0-1777973544830.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33054i44B2372437952A9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mouadrhm_0-1777973544830.png" alt="Mouadrhm_0-1777973544830.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Pool&lt;/STRONG&gt; does &lt;STRONG&gt;not&lt;/STRONG&gt; expose the pool name as an attribute → the pool name only appears in the ObjectName display, not as a key property&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mouadrhm_1-1777973618034.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33056iAE598510980B5292/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mouadrhm_1-1777973618034.png" alt="Mouadrhm_1-1777973618034.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mouadrhm_2-1777973646376.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33057i157BAE219AF9D14A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mouadrhm_2-1777973646376.png" alt="Mouadrhm_2-1777973646376.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Because of this, when &lt;STRONG&gt;multiple Hikari pools run in the same JVM&lt;/STRONG&gt;, Dynatrace:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;collects Pool metrics correctly&lt;/LI&gt;&lt;LI&gt;but &lt;STRONG&gt;aggregates them at JVM level&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;making it impossible to split runtime metrics (ActiveConnections, IdleConnections, etc.) per pool&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Pool A: IdleConnections = 2&lt;/LI&gt;&lt;LI&gt;Pool B: IdleConnections = 5&lt;/LI&gt;&lt;LI&gt;Dynatrace reports: IdleConnections = 7 for the same process&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This makes per‑pool monitoring and alerting unreliable.&lt;/P&gt;&lt;P&gt;Constraints:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I cannot modify the application code&lt;/LI&gt;&lt;LI&gt;I cannot change how HikariCP exposes its JMX MBeans&lt;/LI&gt;&lt;LI&gt;Only the Dynatrace side (extension/configuration) can be adjusted&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;BR /&gt;Is this a known limitation with HikariCP JMX in Dynatrace Managed?&lt;BR /&gt;Is there any supported Dynatrace‑side workaround to avoid Pool metric aggregation when multiple pools exist in the same JVM?&lt;/P&gt;&lt;P&gt;Thanks in advance for any feedback or guidance.&lt;BR /&gt;My extension code :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;name: custom:hikari.jmx.metrics
version: 1.0.1
minDynatraceVersion: 1.303.0

author:
  name: M
metrics:
  - key: hikari.connections.active
    metadata:
      displayName: Hikari Active Connections
      unit: Count

  - key: hikari.connections.idle
    metadata:
      displayName: Hikari Idle Connections
      unit: Count

  - key: hikari.connections.total
    metadata:
      displayName: Hikari Total Connections
      unit: Count

  - key: hikari.threads.awaiting
    metadata:
      displayName: Hikari Threads Awaiting Connection
      unit: Count

  - key: hikari.connections.acquired
    metadata:
      displayName: Hikari Connections Acquired
      unit: Count

  - key: hikari.connections.created
    metadata:
      displayName: Hikari Connections Created
      unit: Count

  - key: hikari.connections.timeout
    metadata:
      displayName: Hikari Connections Timeout
      unit: Count

  - key: hikari.config.connection.timeout
    metadata:
      displayName: Hikari Connection Timeout
      unit: MilliSecond

  - key: hikari.config.idle.timeout
    metadata:
      displayName: Hikari Idle Timeout
      unit: MilliSecond

  - key: hikari.config.max.lifetime
    metadata:
      displayName: Hikari Max Lifetime
      unit: MilliSecond

  - key: hikari.config.validation.timeout
    metadata:
      displayName: Hikari Validation Timeout
      unit: MilliSecond

  - key: hikari.config.minimum.idle
    metadata:
      displayName: Hikari Minimum Idle
      unit: Count

  - key: hikari.config.maximum.pool.size
    metadata:
      displayName: Hikari Maximum Pool Size
      unit: Count

  - key: hikari.config.leak.detection.threshold
    metadata:
      displayName: Hikari Leak Detection Threshold
      unit: MilliSecond

  - key: hikari.config.keepalive.time
    metadata:
      displayName: Hikari Keepalive Time
      unit: MilliSecond

  - key: hikari.config.initialization.fail.timeout
    metadata:
      displayName: Hikari Initialization Fail Timeout
      unit: MilliSecond

jmx:
  groups:
    - group: hikari
      subgroups:

        # =========================
        # POOL (pool.name depuis ObjectName)
        # =========================
        - subgroup: pool
          query: "com.zaxxer.hikari:type=Pool (*)"

          dimensions:
            - key: pool.name
              value: property:name

          metrics:
            - key: hikari.connections.active
              type: gauge
              value:
                attribute: ActiveConnections

            - key: hikari.connections.idle
              type: gauge
              value:
                attribute: IdleConnections

            - key: hikari.connections.total
              type: gauge
              value:
                attribute: TotalConnections

            - key: hikari.threads.awaiting
              type: gauge
              value:
                attribute: ThreadsAwaitingConnection

            - key: hikari.connections.acquired
              type: count
              value:
                attribute: ConnectionsAcquired

            - key: hikari.connections.created
              type: count
              value:
                attribute: ConnectionsCreated

            - key: hikari.connections.timeout
              type: count
              value:
                attribute: ConnectionsTimeout

        # =========================
        # POOL CONFIG (pool.name via attribute)
        # =========================
        - subgroup: poolconfig
          query: "com.zaxxer.hikari:type=PoolConfig (*)"

          dimensions:
            - key: pool.name
              value:
                attribute: PoolName

          metrics:
            - key: hikari.config.connection.timeout
              type: gauge
              value:
                attribute: ConnectionTimeout

            - key: hikari.config.idle.timeout
              type: gauge
              value:
                attribute: IdleTimeout

            - key: hikari.config.max.lifetime
              type: gauge
              value:
                attribute: MaxLifetime

            - key: hikari.config.validation.timeout
              type: gauge
              value:
                attribute: ValidationTimeout

            - key: hikari.config.minimum.idle
              type: gauge
              value:
                attribute: MinimumIdle

            - key: hikari.config.maximum.pool.size
              type: gauge
              value:
                attribute: MaximumPoolSize

            - key: hikari.config.leak.detection.threshold
              type: gauge
              value:
                attribute: LeakDetectionThreshold

            - key: hikari.config.keepalive.time
              type: gauge
              value:
                attribute: KeepaliveTime

            - key: hikari.config.initialization.fail.timeout
              type: gauge
              value:
                attribute: InitializationFailTimeout&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 May 2026 09:38:56 GMT</pubDate>
    <dc:creator>Mouadrhm</dc:creator>
    <dc:date>2026-05-05T09:38:56Z</dc:date>
    <item>
      <title>HikariCP JMX – Unable to split Pool metrics by pool name when multiple pools exist in the same JVM</title>
      <link>https://community.dynatrace.com/t5/Extensions/HikariCP-JMX-Unable-to-split-Pool-metrics-by-pool-name-when/m-p/299002#M7249</link>
      <description>&lt;DIV&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m working with &lt;STRONG&gt;Dynatrace Managed on prem&lt;/STRONG&gt; and a &lt;STRONG&gt;custom JMX extension&lt;/STRONG&gt; to collect &lt;STRONG&gt;HikariCP metrics&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I can successfully collect metrics from both:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;com.zaxxer.hikari:type=PoolConfig&lt;/LI&gt;&lt;LI&gt;com.zaxxer.hikari:type=Pool&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is however an important difference between the two:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;PoolConfig&lt;/STRONG&gt; exposes a PoolName attribute → I can define a dimension (e.g. pool.name) and split metrics per pool&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mouadrhm_0-1777973544830.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33054i44B2372437952A9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mouadrhm_0-1777973544830.png" alt="Mouadrhm_0-1777973544830.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Pool&lt;/STRONG&gt; does &lt;STRONG&gt;not&lt;/STRONG&gt; expose the pool name as an attribute → the pool name only appears in the ObjectName display, not as a key property&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mouadrhm_1-1777973618034.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33056iAE598510980B5292/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mouadrhm_1-1777973618034.png" alt="Mouadrhm_1-1777973618034.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mouadrhm_2-1777973646376.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/33057i157BAE219AF9D14A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mouadrhm_2-1777973646376.png" alt="Mouadrhm_2-1777973646376.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Because of this, when &lt;STRONG&gt;multiple Hikari pools run in the same JVM&lt;/STRONG&gt;, Dynatrace:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;collects Pool metrics correctly&lt;/LI&gt;&lt;LI&gt;but &lt;STRONG&gt;aggregates them at JVM level&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;making it impossible to split runtime metrics (ActiveConnections, IdleConnections, etc.) per pool&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Pool A: IdleConnections = 2&lt;/LI&gt;&lt;LI&gt;Pool B: IdleConnections = 5&lt;/LI&gt;&lt;LI&gt;Dynatrace reports: IdleConnections = 7 for the same process&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This makes per‑pool monitoring and alerting unreliable.&lt;/P&gt;&lt;P&gt;Constraints:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I cannot modify the application code&lt;/LI&gt;&lt;LI&gt;I cannot change how HikariCP exposes its JMX MBeans&lt;/LI&gt;&lt;LI&gt;Only the Dynatrace side (extension/configuration) can be adjusted&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;BR /&gt;Is this a known limitation with HikariCP JMX in Dynatrace Managed?&lt;BR /&gt;Is there any supported Dynatrace‑side workaround to avoid Pool metric aggregation when multiple pools exist in the same JVM?&lt;/P&gt;&lt;P&gt;Thanks in advance for any feedback or guidance.&lt;BR /&gt;My extension code :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;name: custom:hikari.jmx.metrics
version: 1.0.1
minDynatraceVersion: 1.303.0

author:
  name: M
metrics:
  - key: hikari.connections.active
    metadata:
      displayName: Hikari Active Connections
      unit: Count

  - key: hikari.connections.idle
    metadata:
      displayName: Hikari Idle Connections
      unit: Count

  - key: hikari.connections.total
    metadata:
      displayName: Hikari Total Connections
      unit: Count

  - key: hikari.threads.awaiting
    metadata:
      displayName: Hikari Threads Awaiting Connection
      unit: Count

  - key: hikari.connections.acquired
    metadata:
      displayName: Hikari Connections Acquired
      unit: Count

  - key: hikari.connections.created
    metadata:
      displayName: Hikari Connections Created
      unit: Count

  - key: hikari.connections.timeout
    metadata:
      displayName: Hikari Connections Timeout
      unit: Count

  - key: hikari.config.connection.timeout
    metadata:
      displayName: Hikari Connection Timeout
      unit: MilliSecond

  - key: hikari.config.idle.timeout
    metadata:
      displayName: Hikari Idle Timeout
      unit: MilliSecond

  - key: hikari.config.max.lifetime
    metadata:
      displayName: Hikari Max Lifetime
      unit: MilliSecond

  - key: hikari.config.validation.timeout
    metadata:
      displayName: Hikari Validation Timeout
      unit: MilliSecond

  - key: hikari.config.minimum.idle
    metadata:
      displayName: Hikari Minimum Idle
      unit: Count

  - key: hikari.config.maximum.pool.size
    metadata:
      displayName: Hikari Maximum Pool Size
      unit: Count

  - key: hikari.config.leak.detection.threshold
    metadata:
      displayName: Hikari Leak Detection Threshold
      unit: MilliSecond

  - key: hikari.config.keepalive.time
    metadata:
      displayName: Hikari Keepalive Time
      unit: MilliSecond

  - key: hikari.config.initialization.fail.timeout
    metadata:
      displayName: Hikari Initialization Fail Timeout
      unit: MilliSecond

jmx:
  groups:
    - group: hikari
      subgroups:

        # =========================
        # POOL (pool.name depuis ObjectName)
        # =========================
        - subgroup: pool
          query: "com.zaxxer.hikari:type=Pool (*)"

          dimensions:
            - key: pool.name
              value: property:name

          metrics:
            - key: hikari.connections.active
              type: gauge
              value:
                attribute: ActiveConnections

            - key: hikari.connections.idle
              type: gauge
              value:
                attribute: IdleConnections

            - key: hikari.connections.total
              type: gauge
              value:
                attribute: TotalConnections

            - key: hikari.threads.awaiting
              type: gauge
              value:
                attribute: ThreadsAwaitingConnection

            - key: hikari.connections.acquired
              type: count
              value:
                attribute: ConnectionsAcquired

            - key: hikari.connections.created
              type: count
              value:
                attribute: ConnectionsCreated

            - key: hikari.connections.timeout
              type: count
              value:
                attribute: ConnectionsTimeout

        # =========================
        # POOL CONFIG (pool.name via attribute)
        # =========================
        - subgroup: poolconfig
          query: "com.zaxxer.hikari:type=PoolConfig (*)"

          dimensions:
            - key: pool.name
              value:
                attribute: PoolName

          metrics:
            - key: hikari.config.connection.timeout
              type: gauge
              value:
                attribute: ConnectionTimeout

            - key: hikari.config.idle.timeout
              type: gauge
              value:
                attribute: IdleTimeout

            - key: hikari.config.max.lifetime
              type: gauge
              value:
                attribute: MaxLifetime

            - key: hikari.config.validation.timeout
              type: gauge
              value:
                attribute: ValidationTimeout

            - key: hikari.config.minimum.idle
              type: gauge
              value:
                attribute: MinimumIdle

            - key: hikari.config.maximum.pool.size
              type: gauge
              value:
                attribute: MaximumPoolSize

            - key: hikari.config.leak.detection.threshold
              type: gauge
              value:
                attribute: LeakDetectionThreshold

            - key: hikari.config.keepalive.time
              type: gauge
              value:
                attribute: KeepaliveTime

            - key: hikari.config.initialization.fail.timeout
              type: gauge
              value:
                attribute: InitializationFailTimeout&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 09:38:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/HikariCP-JMX-Unable-to-split-Pool-metrics-by-pool-name-when/m-p/299002#M7249</guid>
      <dc:creator>Mouadrhm</dc:creator>
      <dc:date>2026-05-05T09:38:56Z</dc:date>
    </item>
  </channel>
</rss>

