JMX インターフェイスを使用したライブ モニタリング

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

JMX (Java Management Extensions API) allows you to monitor the status of your Confluence instance in real time. JMX uses objects called MBeans (Managed Beans) to expose data and resources from your application, providing useful data such as the resource usage of your instance and its database latency, allowing you to diagnose problems or performance issues.

On this page, we'll guide you through how to use JConsole to monitor Confluence locally and remotely. JConsole is included in the Java Development Kit (JDK), but you can use any JMX client.

This page also contains information about In-product diagnostics available through JMX.

This guide provides a basic introduction to the JMX interface and is provided as is. Our Support team can help you troubleshoot a specific Confluence problem, but aren't able to help you set up your monitoring system or interpret the results.

JMX によって Confluence を監視する

APM によって Confluence をリモート監視する

アプリケーション パフォーマンス監視 (APM) ツールで Confluence を監視するには、JMX エクスポーターをインストールして JMX MBeans をご利用のツールに適した形式に変換する必要があります。その方法については「アプリのパフォーマンスを監視する」をご参照ください。 

アプリケーション パフォーマンス監視 (APM) システムをお持ちでないユーザー向けに、Prometheus と Grafana を開始するためのガイドを作成しました。このガイドには、出発点にできるテンプレート ダッシュボードも含まれています。「Prometheus と Grafana で Confluence を監視する」をご参照ください。

JConsole を使用してた Confluence のリモート監視

リモート監視は、Confluence サーバーのリソースを消費しないため、本番環境システムにお勧めです。

リモートで監視するには:

  1. 以下のプロパティを setenv.sh / setenv.bat ファイルに追加します。ポートは未使用の任意のポートに設定できます。

    set CATALINA_OPTS=-Dcom.sun.management.jmxremote %CATALINA_OPTS%
    set CATALINA_OPTS=-Dcom.sun.management.jmxremote.port=8099 %CATALINA_OPTS%
  2. リモート接続の保護方法を決定します。詳細は、リモート監視と管理 を参照してください。
    認証を無効化することは可能ですが、本番環境システムではお勧めしません。

  3. JConsole を起動します (JDK インストール ディレクトリの bin ディレクトリにあります)。
  4. リモート プロセス を選択します。
  5. ホスト名とポートを (Confluence ポートではなく、以前に指定したポート) を入力します。
  6. 接続 をクリックします。

リモート監視の詳細については、JConsole の使用を参照してください。

JConsole を使用して Confluence をローカルで監視する

If you are troubleshooting a particular issue, or only need to monitor Confluence for a short time, you can use local monitoring. Local monitoring can have a performance impact on your server, so its not recommended for long-term monitoring of your production system.

ローカルに監視するには:

  1. JConsole を起動します (JDK インストール ディレクトリの bin ディレクトリにあります)。

  2. ローカル プロセス を選択します。
  3. Confluence プロセスを選択します。org.apache.catalina.startup.Bootstrap start のようになります。

ローカル監視の詳細については、JConsole の使用を参照してください。

JMX メトリックをログ ファイルに書き込む

次の JMX メトリクスをログ ファイルに書き込むことも選択できます。これは、問題をトラブルシューティングする際に便利です。

  • キャッシュ統計
  • IndexingStatistics
  • MailTaskQueue
  • RequestMetrics
  • システム情報
  • スレッド プール
  • OS
  • GC
  • Threading
  • TomcatManager
  • RequestProcessor

JMX メトリクスをログ ファイルに書き込むには、次の手順に従います。

  1. > [一般設定] > [スケジュール ジョブ]の順に移動します。
  2. JMX メトリックをログ ジョブを有効にします。 

This job runs once per minute by default, and writes metrics to the <local-home/logs/atlassian-confluence-jmx.log file. See Working with Confluence Logs

JMX 監視を無効にする

JMX 監視を無効にするには、次の手順に従います。

  1. > [一般設定] > [監視] の順に移動します。
  2. [JMX 監視] を選択解除します。

これによって、JMX を有効にする必要があるためアプリ監視も無効になります。 

Confluence MBeans

以下の Confluence MBeans を使用して、Confluence インスタンスに関するライブ情報を確認できます。

キャッシュ統計

この MBean は、Confluence バージョンや稼働時間などの情報を示します。この情報は、キャッシュ統計ページにも表示されます。

IndexingStatistics

この MBean は検索インデックス作成に関連する情報を表示します。便利な属性をいくつか示します。

プロパティ名

機能

Flushing

キャッシュが現在フラッシュ中かどうかを示す

True/False

LastElapsedMilliseconds

最後のインデックス作成の所要時間

ミリ秒

TaskQueueLength

キューにあるタスクの数を表示

整数

ReIndexing Confluence が現在再インデックス中かどうかを示すTrue/False

システム情報

この MBean は、Confluence バージョンや稼働時間などの情報を示します。この情報は、システム情報ページにも表示されます。  

プロパティ名

機能

DatabaseExampleLatency

データベース対して実行されたクエリ例の待ち時間を表示。

ミリ秒

RequestMetrics

この MBean はシステム負荷と表示されたエラーページに関連する情報を表示します。

プロパティ名

機能

AverageExecutionTimeForLastTenRequests

最新 10 件の要求の平均実行時間。

ミリ秒

CurrentNumberOfRequestsBeingServed

この時点で提供されている要求の数。

整数

ErrorCount

Confluence エラーページが提供された回数。

整数

NumberOfRequestsInLastTenSeconds

最近 10 秒間の要求数。

整数

MailServer-SMTPServer

この MBean は、メールディスパッチの試行と失敗に関連する情報を表示します。Confluence インスタンスで設定された SMTP メールサーバーごとに MBean があります。

プロパティ名

機能

EmailsAttempted

Confluence が送信しようとしたメールメッセージの数。

整数

EmailsSent

正常に送信されたメールメッセージの数。

整数

MailTaskQueue

この MBean は、メールワークロードに関連する情報を示します。

プロパティ名

機能

ErrorQueueSize

キュー内のエラー数。

整数

Flushing

状態 (フラッシュの有無) を表示。

True/False

FlushStarted

稼働を開始した時間。

時間

RetryCount

実行された再試行の回数。

整数

TaskSize

ディスパッチのためにキューに入れられたメールメッセージの数。

整数

SchedulingStatistics

この MBean は現在のジョブ、スケジュール済みタスク、およびそれらが最後に実行された時間に関連する情報を表示します。

プロパティ名機能
AllJobNames現在のジョブ、スケジュール済みタスク、およびそれらが最後に実行された時間に関連する情報を表示する文字列
CurrentlyRunningJobNames現在実行中のスケジュール済みジョブを一覧表示する一覧

アプリ固有の指標

アプリ監視を有効にして、Marketplace やカスタムビルド アプリに関する問題のトラブルシューティングに役立つ追加の指標を表示します。 

アプリ固有の指標に関する全リストは「アプリ指標の参照」をご参照ください。

追加の MBeans

Hibernate および Hazelcast を監視する (Confluence Data Center のみ) には、まず、setenv.sh / setenv.bat ファイルに次のプロパティを追加する必要があります。 

set CATALINA_OPTS=-Dconfluence.hazelcast.jmx.enable=true %CATALINA_OPTS%
set CATALINA_OPTS=-Dconfluence.hibernate.jmx.enable=true %CATALINA_OPTS%

これにより、お使いの JMX クライアントでハイバーネイトおよび Hazelcast MBeans を使用できるようになります。 

CPU 消費量が多いスレッドを監視する

JConsole の上位スレッド プラグインは、CPU のスパイクが発生しているかどうかを監視するのに便利です。以下のコマンドを使用して、このコマンドで JConsole を起動します。

JConsole -pluginpath /pathto/topthreads.jar

In-product diagnostics available through JMX

We've introduced a set of database connectivity and HTTP connection metrics for in-product diagnostics available through JMX.

In-product diagnostics (IPD) provide greater insights for you and Atlassian Support into how running Confluence instances are operating.

IPD uses additional metrics handling Confluence’s interactions with its database. For example, using database connectivity metrics, you can efficiently identify what in your environment or infrastructure may be responsible for performance issues. 

この機能は既定で有効になっています。実際のメトリックは次の形式で利用できます。

  • 新しい JMX MBeans として

  • as a history of snapshots of the JMX values in the new IPD log file atlassian-confluence-ipd-monitoring.log. See Working with Confluence Logs

    • The log file is also included in the Support Zip file created in the Atlassian Troubleshooting and Support app. If needed, send the zip file to Atlassian Support who has the internal tools to interpret it.

In-product diagnostics metrics

Expand the following sections to learn more about the metrics available for in-product diagnostics.

To use the metrics, make sure you’ve first enabled JMX.

データベース接続メトリック

MBean オブジェクト名

メトリックの説明

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=latency,name=value

  • db.connection.latency.value

データベースに対するクエリ送信時の最新のレイテンシ測定値

Set to -1 when database connectivity is lost

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=latency,name=statistics

  • db.connection.latency.statistics

前回の再起動以降のレイテンシの集計統計

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=pool,category02=numActive,
name=statistics

  • db.connection.pool.numActive.statistics

前回の再起動以降のデータベース接続プール内のアクティブ接続数の集計統計

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=pool,category02=numActive,
name=value

  • db.connection.pool.numActive.value

The latest measure of the number of active connections in the database connection pool.

Set to -1 when database connectivity is lost

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=pool,category02=numIdle,
name=statistics

  • db.connection.pool.numIdle.statistics

Aggregated statistics of the number of idle connections in the database connection pool since the last restart

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=pool,category02=numIdle,
name=value

  • db.connection.pool.numIdle.value

The latest measure of the number of idle connections in the database connection pool.

Set to -1 when database connectivity is lost

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=state,name=value

  • db.connection.state.value

The latest indicator, 0 for a failed connection or 1 for a working connection, of the state of the connection to the database

com.atlassian.confluence:type=metrics,
category00=db,category01=connection,
category02=failures,name=counter

  • db.connection.failures.counter

前回の再起動以降のデータベース接続障害の回数

HTTP connection metrics

Bean ObjectName

メトリックの説明

com.atlassian.confluence:type=metrics,
category00=http,category01=connection,
category02=pool,category03=numActive,
name=value

  • http.connection.pool.numActive.value

The latest measure of the number of active connections in the HTTP connection pool. If more than one pool is defined, the sum of active connections from all pools is returned.

com.atlassian.confluence:type=metrics,
category00=http,category01=connection,
category02=pool,category03=numIdle,
name=value

  • http.connection.pool.numIdle.value

The latest measure of the number of idle connections in the HTTP connection pool. If more than one pool is defined, the sum of idle connections from all pools is returned.

com.atlassian.confluence:type=metrics,
category00=http,category01=connection,
category02=pool,category03=numMax,
name=value

  • http.connection.pool.numMax.value

The maximum number of threads to be created by the HTTP connectors and made available for requests.

com.atlassian.confluence:type=metrics,
category00=http,category01=connection,
category02=sessions,category03=active,
name=value

  • http.connection.sessions.active.value

The latest measure of the number of active user sessions

com.atlassian.confluence:type=metrics,
category00=http,category01=connection,
category02=sessions,category03=active,
name=statistics

  • http.connection.sessions.active.statistics

Aggregated statistics of the number of active user sessions

com.atlassian.confluence:type=metrics,
category00=http,category01=connection,
category02=sessions,category03=recent,
name=value

  • http.connection.sessions.recent.value

The latest measure of the number of recent user sessions. Recent session is the session that has been active in the last one hour

com.atlassian.confluence:type=metrics
category00=http,category01=requests,
name=value

  • http.requests.value

The latest measure of the total number of HTTP requests per minute

com.atlassian.confluence:type=metrics,
category00=http,category01=requests,
name=statistics

  • http.requests.statistics

Aggregated statistics of the total number of HTTP requests per minute

Enabling in-product diagnostics monitoring

IPD monitoring is enabled by default. To manage it:

  1. Go to  > General Configuration

  2. In the left panel, select Monitoring.

  3. Use the Enable in-product diagnostics toggle to enable or disable IPD monitoring.

Screenshot: JMX monitoring settings with in-product diagnostics disabled

ログ形式

Writing to atlassian-confluence-ipd-monitoring.log is done via log4j. Its configuration is managed in log4j.properties.

#####################################################
# In-product diagnostics monitoring logging
#####################################################

log4j.appender.ipdLogAppender=com.atlassian.confluence.logging.ConfluenceHomeLogAppender
log4j.appender.ipdLogAppender.LogFileName=atlassian-confluence-ipd-monitoring.log
log4j.appender.ipdLogAppender.MaxFileSize=20480KB
log4j.appender.ipdLogAppender.MaxBackupIndex=5
log4j.appender.ipdLogAppender.layout=com.atlassian.logging.log4j.NewLineIndentingFilteringPatternLayout
log4j.appender.ipdLogAppender.layout.ConversionPattern=%d %m%n

log4j.logger.ipd-monitoring = INFO, consolelog
log4j.additivity.ipd-monitoring = false
log4j.logger.ipd-monitoring-data-logger = INFO, ipdLogAppender
log4j.additivity.ipd-monitoring-data-logger = false

ログの内容

By default, a concise set of data is included in each log entry. An extended set of data can be logged by enabling the confluence.in.product.diagnostics.extended.logging feature flag.

拡張データを有効にするには、次の手順に従います。

  1. Go to <CONFLUENCE_URL>/admin/darkfeatures.action, where <CONFLUENCE_URL> is the base URL of your Confluence instance.

  2. In the Enable dark feature field, enter confluence.in.product.diagnostics.extended.logging

  3. Select SubmitLearn how to manage dark features

    1. To disable the extended data, in the Site Dark Features section, find confluence.in.product.diagnostics.extended.logging and select remove.

In the following tables, see the structures of the concise and extended logging formats.

The metrics in JMX always go in the extended format.


簡潔データ

MBean タイプ

Properties

属性

カウンター

timestamp

ラベル

属性

_count

_value

統計

_99thPercentile

_max

_min

_mean

Show me an example of the concise log line format
2023-01-13 11:51:13,106 IPDMONITORING {"timestamp":"1673610673","label":"DB.CONNECTION.POOL.NUMACTIVE.STATISTICS","attributes":{"_max":"2.0","_mean":"1.2436699769063984","_99thPercentile":"2.0","_count":"5","_min":"1.0"}}

拡張データ

MBean タイプ

Properties

属性

カウンター

timestamp

ラベル

属性

オブジェクト名

_count

_fifteenMinuteRate

_fiveMinuteRate

_meanRate

_oneMinuteRate

_rateUnit

_value

_number

統計

_50thPercentile

_75thPercentile

_95thPercentile

_98thPercentile

_99thPercentile

_999thPercentile

_count

_min

_max

_mean

_stdDev

_durationUnit

_fifteenMinuteRate

_fiveMinuteRate

_meanRate

_oneMinuteRate

_rateUnit

Show me an example of the extended log line format
2022-09-06 18:38:48,015 IPDMONITORING {"timestamp":"1662453528","label":
"DB.CONNECTION.LATENCY.STATISTICS","objectName":
"com.atlassian.confluence:category00\u003ddb,category01\u003dconnection,category02\
u003dlatency,name\u003dstatistics,type\u003dmetrics",
"attributes":{"_oneMinuteRate":"0.02012497818617073","_50thPercentile":"0.0",
"_mean":"1.9379304604014412E-25","_max":"1.0","_stdDev":"4.40219315841711E-13",
"_98thPercentile":"0.0","_meanRate":"0.003612560785169162","_rateUnit":
"events/second","_99thPercentile":"0.0","_count":"16","_durationUnit":
"milliseconds","_75thPercentile":"0.0","_fiveMinuteRate":
"0.005912972095043379","_fifteenMinuteRate":"0.0037696657500141968",
"_999thPercentile":"0.0","_95thPercentile":"0.0","_min":"0.0"}}
最終更新日 2023 年 5 月 22 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.