Amazon CloudWatch と統合する
この記事では、Jira Service Management Cloud の一部のお客様に段階的に展開されている、Jira Service Management でネイティブに利用できる新しいアラート機能を取り上げています。ご利用のサイトにはまだ表示されていないか、利用できない可能性があります。

CloudWatch メトリックは、AWS クラウドで実行されているアプリのモニタリングにおいて重要な役割を果たします。
統合でできるようになること
CloudWatch アラームは、指定された期間に 1 つのメトリックを監視し、監視されたメトリックの値と指定されたしきい値に基づいて自動化されたアクションを実行します。Jira Service Management は、これらのアラームのディスパッチャーとして機能し、オンコール スケジュールに基づいて適切な通知先を決定します。メール、テキスト メッセージ (SMS)、電話、iPhone や Android のプッシュ通知を使用してユーザーに通知し、アラートが承認されるかクローズされるまでアラートをエスカレートします。CloudWatch は問題を検出し、Jira Service Management は適切な担当者が問題に取り組むことを保証します。
統合による機能
CloudWatch でアラートが作成されると、統合を通じて Jira Service Management でアラートが自動的に作成されます。CloudWatch でアラートがクローズされると、統合を介して Jira Service Management で関連するアラートが自動的にクローズされます。
統合をセットアップする
AWS CloudWatch は API ベースの統合です。設定は次の手順で行います。
Jira Service Management で CloudWatch 統合を追加する
AWS CloudWatch でアラームを設定する
CloudWatch 統合を追加する
Bidirectional integrations aren’t supported in Free and Standard plans. All the other integrations are supported at a team level in Free and Standard; however, for their outgoing part to work, you need to upgrade to a higher plan. To add any integration at a site level through Settings
(gear icon) > Products
(under JIRA SETTINGS) > OPERATIONS
, you need to be either on Premium or Enterprise.
統合をチームの運用ページから追加すると、そのチームが統合の所有者になります。つまり、Jira Service Management は、この統合を通じて受信したアラートをチームにのみ割り当てます。
Jira Service Management で CloudWatch 統合を追加するには、次の手順に従います。
チームのオペレーション ページに移動します。
左側のナビゲーション パネルで、[統合]、[統合を追加] の順に選択します。
検索を実行して「AWS CloudWatch」を選択します。
次の画面で、統合の名前を入力します。
オプション: 特定のチームが統合からのアラートを受信するようにする場合は、[Assignee team (担当者チーム)] のチームを選択します。
[Continue] を選択します。
この時点で、統合が保存されます。[統合を設定する手順] セクションを展開し、アカウント用に生成されたエンドポイント URL をコピーします。
この URL は、後ほど AWS CloudWatch で統合を設定する際に使用します。[統合をオンにする] を選択します。
統合のために作成したルールは、統合をオンにした場合にのみ機能します。
CloudWatch でアラームを設定する
Create an SNS topic with the name “Jira Service Management”.
Add an HTTPS subscription to the topic with the Jira Service Management API endpoint URL. This is the endpoint URL you copied while adding the integration in Jira Service Management. If the configuration is successful, a confirmation alert is created in Jira Service Management.
Create a CloudWatch alarm with any metric and select the SNS topic as the action.
Ensure that the alarm name includes resource and metric names for uniqueness and ease of readability. For example, SQS Queue chat_webhook messageCount Too High. Ensure that notifications are sent for all of the states ALARM, OK, and INSUFFICIENT to Jira Service Management. Notifications with state ALARM create alerts, and notifications with states OK and INSUFFICIENT close the matching alerts by default.
この統合では、既定で Region - AlarmName を使用して各アラートのエイリアスが作成されます。このように、Jira Service Management では各 CloudWatch アラームが一意に識別、作成、クローズされます。
アラートをテストする
CloudWatch でアラームの通知をセットアップしたら、アラームが作成されるようにテスト目的でアラームのしきい値を変更します。
アラーム条件が満たされると、AWS CloudWatch はアラームの詳細を Jira Service Management に渡し、Jira Service Management は受信者の通知設定に基づいて指定されたユーザー (受信者パラメーター) に通知します。Jira Service Management アラートには、CloudWatch によって提供されるすべての関連情報が含まれています。
テストが完了したら、CloudWatch アラームのしきい値設定を元の状態に戻します。
CloudWatch から送信されるペイロードの例
アラート ペイロード (JSON 形式) を作成する
{
"Type": "Notification",
"MessageId": "1cf7a0eb-4179-4181-b15b-ea22c5aa0280",
"TopicArn": "arn:aws:sns:us-east-1:08931xxxxxx:CloudWatchHTTPAlarms",
"Subject": "ALARM: \"cpuUtilTest\" in US - N. Virginia",
"Message": "{\"AlarmName\":\"cpuUtilTest\",\"AlarmDescription\":\"testing alarms for cpu utilization\",\"AWSAccountId\":\"08931xxxxxx\",\"NewStateValue\":\"ALARM\",\"OldStateValue\":\"OK\",\"NewStateReason\":\"Threshold Crossed: 1 datapoint (5.199) was greater than or equal to the threshold (5.0).\",\"StateChangeTime\":\"2012-08-05T22:31:25.524+0000\",\"Region\":\"US - N. Virginia\",\"Trigger\":{\"MetricName\":\"CPUUtilization\",\"Namespace\":\"AWS/EC2\",\"Statistic\":\"AVERAGE\",\"Unit\":null,\"Dimensions\":[{\"name\":\"InstanceId\",\"value\":\"i-39e64c5f\"}],\"Period\":900,\"EvaluationPeriods\":1,\"ComparisonOperator\":\"GreaterThanOrEqualToThreshold\",\"Threshold\":5.0}}",
"Timestamp": "2012-08-05T22:31:30.673Z",
"SignatureVersion": "1",
"Signature": "XrsO2wtE0b+ofOl1ZxxxxxxxxlimTUg+rV4U9RmNSSBEdlmyWvtGgpjebsmNv1wkjUsBQOJZjZnpZp5FBn6quAn3twNdRMmMLf15lv6ESbYFxxxxxxxx0vmjj/ZLwiH9Pr/cxVYxxxxxxxYn8w6g=",
"SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c72xxxxxxxxx6de52f.pem",
"UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:08931xxxxxxxx:CloudWatchHTTPAlarms:1841c5ca-ddda-450e-bbfb-xxxxxxxxx"
}
Jira Service Management によって解析されるペイロード (JSON 形式)
{
"TopicArn": "arn:aws:sns:us-east-1:08931xxxxxxx:CloudWatchHTTPAlarms",
"AlarmName": "cpuUtilTest",
"Subject": "ALARM: \"cpuUtilTest\" in US - N. Virginia",
"AlarmDescription": "testing alarms for cpu utilization",
"NewStateReason": "Threshold Crossed: 1 datapoint (5.199) was greater than or equal to the threshold (5.0).",
"NewStateValue": "ALARM",
"OldStateValue": "OK",
"StateChangeTime": "2012-08-05T22:31:25.524+0000",
"Region": "US - N. Virginia",
"Trigger": {
"MetricName": "CPUUtilization",
"Namespace": "AWS/EC2",
"Statistic": "AVERAGE",
"Unit": null,
"Dimensions": [
{
"name": "InstanceId",
"value": "i-39e64c5f"
}
],
"Period": 900,
"EvaluationPeriods": 1,
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Threshold": 5
}
}
この内容はお役に立ちましたか?