アプリケーション パフォーマンスを監視する

Bitbucket Data Center と Server の管理

このページの内容

お困りですか?

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

コミュニティに質問

アプリ監視によって、インスタンスにおけるアプリの動作内容をより深く把握できます。これは、特定のアプリに関する問題のトラブルシューティング、またはアプリが全体的なパフォーマンスや安定性の低下の一因になっているかどうかを判断する際に役立ちます。

監視をセットアップする

Before you can connect your APM, you need to:

  • JMX エクスポーターを設定する

  • make sure that JMX metrics are enabled in your instance (which in turn enable App metrics). 

このページの説明では、Prometheus を使用することを前提としています。どのアプリケーション パフォーマンス監視 (APM) ソリューションを使用する場合でも、手順はほぼ変わりません。

1. JMX エクスポーターを設定する

エクスポーターは JMX MBeans を取得して、Prometheus に適した形式に変換します。また、Prometheus が接続する HTTP エンドポイントをホストします。Prometheus JMX エクスポーターの詳細についてご確認ください。

Prometheus を使用しない場合は、使用する APM ソリューションで必要となるエクスポーターまたはエージェントを確認する必要があります。たとえば、NewRelic 用の Java エージェントなどです。

エクスポーターをインストールするには、次の手順に従います。

  1. GitHub リポジトリから、Prometheus JMX エクスポーター jar ファイルをダウンロードします。

    $ curl -L https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar --output jmx-exporter.jar
  2. Java エクスポーター用の設定ファイルを作成します。サンプル ファイルはリポジトリからダウンロードできます。設定オプションの詳細については、README.md をご参照ください。

  3. jar と設定の各ファイルを各アプリケーション ノードにコピーします (ローカル ホーム ディレクトリが適しています)。

  4. Stop Bitbucket on one node.

  5. Add the following agent properties to $bitbucket_home/bin/_start-webapp.sh of each cluster node to tell Bitbucket where to find the JMX exporter:

    JVM_SUPPORT_RECOMMENDED_ARGS="-javaagent:./jmx-exporter.jar=12345:config.yaml"

    初期設定では、JMX エクスポーターはポート 8080 を使用します。Jira または別のアプリがこのポートを使用している場合は、別のポートをエクスポーター用に指定する必要があります。
     

  6. Start Bitbucket.

  7. エクスポーターが動作していることを確認するには、localhost:<jmx-exporter-port> に移動します。指標の出力が表示されるはずです。

Repeat these steps for all remaining nodes, if you run Bitbucket in a cluster. You can perform a rolling restart to avoid any downtime.

JMX エクスポーター エンドポイントをネットワークの外部に公開しないようにする、または適切なステップに従って、セキュリティを確保します。 

2. Enable application monitoring in Bitbucket

Make sure that JMX monitoring is enables as application monitoring uses JMX (Java Management Extensions). Learn how to enable JMX monitoring

If you have previously set up JMX monitoring for Bitbucket, there’s nothing else you need to do. The additional application monitoring metrics will be exposed in the same way as existing application metrics. For the full list of things, you might want to monitor see Application metrics reference.

既存の APM (アプリ パフォーマンス監視) ソリューションがない場合は、Prometheus と Grafana の開始に関するアトラシアンのガイドをご参照ください。

JMX monitoring can have a performance impact on your instance. In most cases it’s not significant. However if you do experience any problems with your instance performance or stability, you can disable JMX monitoring.

アプリ名を識別する

App metrics include the plugin key rather that the app's display name. For example,  com.atlassian.troubleshooting.plugin-bitbucket is the plugin key for the Troubleshooting and Support Tools system app for Bitbucket. 

アプリ名を確認するには、次の手順に従います。

  1. <base-url>/plugins/servlet/upm/osgi に移動します。

  2. プラグイン キーを [バンドル メタデータの検索] フィールドに入力します。

  3. 名前やベンダーなど、プラグインの詳細が返されます。

プラグイン キーの検索結果を示す OSGi 管理画面

アプリに関するすべての詳細を返す次の REST エンドポイント /rest/plugins/1.0/<plugin-key>/summary も使用できます。 

オプションのタグを有効にする

アプリ ベンダーは、パフォーマンス問題のトラブルシューティング時に役立つ追加メタデータを含められます。初期設定では、これらのタグは含まれていません。

atlassian.metrics.optional.tags システム プロパティによって、指標の追加タグを表示できます。

atlassian.metrics.optional.tags.<metric-name>=<tag-key1>,<tag-key2>

たとえば、完全な指標名が sampleApp.asset.loadtime である場合に、アプリ ベンダーがコンテンツ タイプに関する追加情報を出力するタグを含めたとします。

atlassian.metrics.optional.tags.sampleApp.asset.loadtime=sampleApp-type

これによって、アプリ ベンダーは正確な指標とタグ名を伝えられます。

トラブルシューティング

out of memory (メモリ不足) エラー

監視はアプリの外部で行われるため、インスタンスのパフォーマンスや安定性に対する重大な影響はないと予想されます。問題が発生した場合は、JMX とアプリの各監視を無効にできます。

In the event of out of memory errors (OOME) caused by the monitoring agent, see Bitbucket is reaching resource limits

最終更新日: 2023 年 1 月 31 日

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

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