我們已新增應用程式設定、事件中樞、Azure Cosmos DB、金鑰保存庫、記憶體 Blob、記憶體佇列和記憶體檔案的健康情況指標,以及所有 HTTP 型 Azure SDK 的 Spring Cloud Sleuth 支援。 例如,您現在可以探查以判斷記憶體 Blob 是否透過 Spring Boot 執行器端點啟動或關閉,以及追蹤從應用程式到 金鑰保存庫 的相依性和延遲。
啟用健康情況指標
若要啟用健康情況指標,請將 Spring Cloud Azure 執行器入門版相依性新增至您的 pom.xml 檔案。 這個相依性也會包含 spring-boot-starter-actuator。
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-actuator</artifactId>
</dependency>
下表列出可設定的屬性,以啟用或停用每個 Azure 服務的健全狀況指標:
| Azure 服務 | 財產 |
|---|---|
| 應用程式組態 | management.health.azure-appconfiguration.enabled |
| Azure Cosmos DB | management.health.azure-cosmos.enabled |
| 事件中樞 | management.health.azure-eventhubs.enabled |
| 金鑰保存庫 憑證 | management.health.azure-keyvault-certificate.enabled |
| 金鑰保存庫 秘密 | management.health.azure-keyvault-secret.enabled |
| 儲存體 Blob | management.health.azure-storage-blob.enabled |
| 記憶體檔案共用 | management.health.azure-storage-fileshare.enabled |
| 記憶體佇列 | management.health.azure-storage-queue.enabled |
重要
呼叫 Azure 服務的健康狀態端點可能會產生額外費用。 例如,如果您呼叫 http://HOST_NAME:{port}/actuator/health/cosmos 以取得 Azure Cosmos DB 健康情況資訊,則會計算要求單位 (RU)。 如需詳細資訊,請參閱 Azure Cosmos DB 中的要求單位。
注意
若要呼叫 Cosmos的健康情況端點,應設定選項 spring.cloud.azure.cosmos.database;否則,將會傳回 unknown 的健康狀態。
若要呼叫 Storage Queue的健康狀態端點,如果使用 Storage Account Contributor 進行授權,則需要 Azure AD 角色。
啟用 sleuth
當您想要使用 Spring Cloud Sleuth 追蹤 Azure SDK 活動時,請將下列 Spring Cloud Azure Trace Sleuth 相依性新增至您的 pom.xml 檔案:
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-trace-sleuth</artifactId>
</dependency>
注意
目前僅支援 HTTP 型 Azure SDK 用戶端。 例如,目前不支援使用 AMQP 傳輸的 Event Hubs 和 服務匯流排。 針對這些需求,我們建議您使用 Azure 應用程式 Insight。