【问题标题】:Enable connectionPool monitoring in websphere Liberty在 websphere Liberty 中启用 connectionPool 监控
【发布时间】:2022-01-09 11:42:42
【问题描述】:

我正在尝试为 websphere liberty 服务器上的 oracle 数据库启用连接池指标。根据此文档https://www.ibm.com/docs/en/was-liberty/nd?topic=10-connectionpool-monitoring 在 featuremanager 中添加 monitor-1.0 功能并添加此行 WebSphere:type=ConnectionPoolStats,name= 在 server.xml 中将开始公开连接池指标,但我不确定 的值是多少。?是jdbc url吗?

我正在使用 jmx_exporter java 代理,它能够获取其他指标,包括 jvm 指标,但不能获取 jdbc 指标。

【问题讨论】:

    标签: prometheus connection-pooling websphere-liberty jmx-exporter


    【解决方案1】:

    根据这个 documentation page 为 Liberty,

    name 是 JNDI 名称(如果已定义),或者是 DataSource 或 ConnectionFactory 的 id。 id 可以由服务器显式定义或生成。

    通常,您将在数据源(或 connectionFactory)上配置一个 jndiName,例如,

    <dataSource id="myDataSource" jndiName="jdbc/myDataSource">
      <jdbcDriver libraryRef="JDCBLib"/>
      <properties .../>
    </dataSource>
    

    在上述情况下,我们使用jndiName 属性的值,在上述情况下为jdbc/myDataSource

    这是一个没有jndiName 的示例,在这种情况下,名称dataSource[DefaultDataSource]/connectionManager 是根据数据源id 生成的,并且缺少明确定义的connectionManager,

    <dataSource id="DefaultDataSource">
      <jdbcDriver libraryRef="JDCBLib"/>
      <properties .../>
    </dataSource>
    

    这是一个没有jndiName 的示例,在这种情况下,名称dataSource[DefaultDataSource]/connectionManager[default-0] 是根据数据源id 和存在的嵌套connectionManager 生成的,

    <dataSource id="DefaultDataSource">
      <connectionManager maxPoolSize="10"/>
      <jdbcDriver libraryRef="JDCBLib"/>
      <properties .../>
    </dataSource>
    

    如果您没有jndiName 并且您的配置看起来不像上述之一,请发布您的配置,我可以帮助您根据它确定标识符。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 2016-05-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多