1. ステータス

ステータス

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

ステータスは、監視目的で使用できる REST API のエンドポイント部分です。 サポートされているのは GET メソッドのみです。

Sitecore Content Hub のバージョン 2.9.0 以降、Web サーバー自体に問題が発生しない限り、リソースは常に利用可能であると想定されるようになりました。 つまり、リソースの HTTP コードをシステムのステータスや状態に関する唯一のソース情報として使用することはもはやできません。 状態を監視する目的で、リソース自体が拡張されて情報が追加されています。

アクション:

ここでは、ほとんどのステータス リソースについて説明します。 リソースは、ほとんどが自己記述的になるように設計されています。

/api/status 以外のすべてのリソースは、使用のための許可と、管理者でのログインが必要です。

ステータス

GET /api/status

このアクションでは、使用可能なすべてのアクションのインデックスと、いくつかの基本および最小限のステータス情報にアクセスできます。 このリソースは承認を必要としないため、公開されています。

リソースのペイロードの例は次のとおりです。

{
    "hostname": "host_name",
    "aggregated_service_status_label": "{status}",
    "queues": {
        "href": "http://localhost:8080/api/status/queues",
        "title": "Status of the message queues"
    },
    "jobs": {
        "href": "http://localhost:8080/api/status/jobs",
        "title": "Status of the processing jobs"
    },
    "users": {
        "href": "http://localhost:8080/api/status/users",
        "title": "Status of the user base"
    },
    "licenses": {
        "href": "http://localhost:8080/api/status/licenses",
        "title": "State of your license"
    },
    "system": {
        "href": "http://localhost:8080/api/status/system",
        "title": "Obsolete resource, use graph, storage and or search resource instead"
    },
    "error": {
        "href": "http://localhost:8080/api/status/error",
        "title": "Resource which allways returns an error"
    },
    "data_storage": {
        "href": "http://localhost:8080/api/status/datastorage",
        "title": "Status and statistics of the storage layer"
    },
    "search": {
        "href": "http://localhost:8080/api/status/search",
        "title": "Status and statistics of the search services"
    },
    "graph": {
        "href": "http://localhost:8080/api/status/graph{?forceRefresh}",
        "title": "Status and statistics of the graph server and its workers",
        "templated": true
    },
    "service_status": {
        "href": "http://localhost:8080/api/status/servicestatus",
        "title": "Detailed service status ecplaining the aggregating status here"
    },
    "kpis": {
        "href": "http://localhost:8080/api/status/kpis",
        "title": "Key performance indicators state"
    }
}

このリソースは、すべてのサブリソースと次のステータス情報にアクセスできます。

  • hostname: このリソースを提供するマシンのホスト名
  • aggregated_service_status_label: システムの全体的な状態を説明するスカラー サービス ステータス。 値はカラー コード文字列です (以下で詳述)。 値が Green に設定されていない場合は、/api/status/servicestatus リソースで詳細情報を確認することをお勧めします。

色分けされたサービス ステータス: このカラー コードは、ステータス リソースだけでなく、詳細なサービス ステータス リストでも使用されます。 コードは大文字と小文字の区別なしで扱う必要があります。 値とそれに対応する解釈は次のとおりです。

  • Green: すべて問題なし
  • Yellow: すべてが機能している (サービスが利用可能である) ものの、Yellow ステータスは、いくつかのパフォーマンスの問題を示します。 通常の操作では、このステータスは妥当な短時間で自動的に Green ステータスに解決されます。 Green ステータスに解決されず、Yellow ステータスが長く続く場合は、深刻なシステム パフォーマンスの低下に関する警告として認識し、人間の介入によって解決する必要があります。
  • Orange: このステータスは、サービスに重大な問題がある可能性を示す最初の重大なステータスです。このステータスが設定されている場合、サービスの可用性は完全には保証されません。 この状態が (Red のように) ブロッキングであるのか、(Yellow のように) 合理的に無視できるのかを判断するには、人間の介入が必要です。 この状態は、データの損失、ブロッキング動作につながる可能性のある繰り返しのエラー、または深刻ではあるが致命的ではない状態を示している場合があります。
  • Red: これは致命的で、サービスが完全に利用できない、またはその状態が深刻であることを示しています。

エラー

GET /api/status/error

このアクションは、テスト目的で例外をスローするだけです。 これは、例外のログが適切に機能しているかどうかをテストするのに役立ちます。

キュー

GET /api/status/queues

このアクションは、メッセージ キューに関する統計を返します。

ジョブ

GET /api/status/jobs/{retentionPeriod}

このアクションは、指定された保持期間を使用して、ジョブのタイプと条件に関する統計を返します。 retentionPeriod はオプションのパラメーターです (既定値は 30 日です)。

システム

GET /api/status/system

これは、Sitecore Content Hub のバージョン 2.9.0 以降では廃止されたリソースで、Redis サービスと Elasticsearch サービスに関する統計情報を提供していました。 代わりに、次のリソースを使用してください。

  • /api/status/datastorage
  • /api/status/search
  • /api/status/graph
  • /api/status/servicestatus

データ ストレージ

GET /api/status/datastorage

このリソースは、データ ストレージ (メディア アセット ストレージを除くコア アプリケーション ストレージ) のステータスと統計を提供します。 現在、データ ストレージ サービスは Redis インスタンスによって提供されており、提供される統計情報とステータス情報はストレージ タイプによって大きく異なります。

検索

GET /api/status/search

このリソースは、検索サービスのステータスと統計を提供します。 現在、検索サービスは Elasticsearch クラスターによって提供されており、データ検索はデータ ストレージによってバックアップされています。 統計情報とステータス情報は、検索サービスの実装によって大きく異なりますが、そのまま提供されます。

グラフ

GET /api/status/system

このリソースは、ベース サービスのグラフ ワーカーで現在ホストされているグラフ サービスのステータスと統計を提供します。 グラフ サービスは、データ ストレージと検索サービスの間の橋渡しの役割を果たすもので、検索サービスの最新情報には不可欠です。 このリソースによって提供される統計情報とステータス情報は、グラフ ネイティブの REST API によって公開されるものと同じです。

サービス ステータス

GET /api/status/servicestatus

/api/status に存在するスカラー サービス ステータス値に加えて、このリソースは、サービス、そのステータス (状態)、およびトラブルシューティング用の追加のメタデータを、完全な階層リストで提供します。 このリソースは、サービスの実装にとらわれないようにするという意図をもって構築されており、人間と機械が読み取れる明確な概要を提供します。 このリソースの例は次のとおりです。

{
    "service_status_label": "Green",
    "service_status_message": "OK",
    "aggregated_service_status_label": "Yellow",
    "downstream_services": {
        "search": {
            "service_status_label": "Yellow",
            "service_status_message": "All primary shards are active, but not all replica shards are active.",
            "aggregated_service_status_label": "Yellow",
            "downstream_services": null
        },
        "data_storage": {
            "service_status_label": "Green",
            "service_status_message": "OK",
            "aggregated_service_status_label": "Green",
            "downstream_services": null
        },
        "graph": {
            "service_status_label": "Green",
            "service_status_message": "OK",
            "aggregated_service_status_label": "Green",
            "downstream_services": {
                "Stylelabs.M.Graph.Audit.AuditGraphWorker": {
                    "service_status_label": "Green",
                    "service_status_message": "No severe incidents have been reported",
                    "aggregated_service_status_label": "Green",
                    "downstream_services": null
                },
                "Stylelabs.M.Graph.ContinuousTests.FuzzServer": {
                    "service_status_label": "Green",
                    "service_status_message": "No severe incidents have been reported",
                    "aggregated_service_status_label": "Green",
                    "downstream_services": null
                },
                "Stylelabs.M.Graph.ElasticSearch.ElasticSearchGraphWorker": {
                    "service_status_label": "Green",
                    "service_status_message": "No severe incidents have been reported",
                    "aggregated_service_status_label": "Green",
                    "downstream_services": null
                }
            }
        }
    },
    "self": {
        "href": "{host}/api/status/servicestatus"
    }
}

上記の例からわかるように、aggregated_service_status_labeldownstream_services をたどることで、パフォーマンスの低下や深刻な問題の原因を簡単に特定できます。 service_status_message で提供されるメッセージは、簡潔でありながら有用になるように作られています。現時点では、個々のサービス ログにアクセスして、利用可能なすべてのフォレンジック情報を取得する必要があります。

この記事を改善するための提案がある場合は、 お知らせください!