通用應用程式屬性

各種屬性可以在您的 application.properties 檔案、application.yml 檔案或作為命令列開關指定。本附錄提供常見的 Spring Cloud Commons 屬性列表,以及參考使用它們的底層類別。

屬性貢獻可能來自類別路徑中的其他 jar 檔案,因此您不應將此視為詳盡的列表。此外,您可以定義自己的屬性。

可觀察性中繼資料

可觀察性 - 指標

您可以在下方找到此專案宣告的所有指標列表。

斷路器函數觀察

當我們將傳遞給 CircuitBreaker 的 Function 包裝為 fallback 時建立的觀察。

指標名稱 spring.cloud.circuitbreaker (由慣例類別 org.springframework.cloud.client.circuitbreaker.observation.DefaultCircuitBreakerObservationConvention 定義)。類型 timer

指標名稱 spring.cloud.circuitbreaker.active (由慣例類別 org.springframework.cloud.client.circuitbreaker.observation.DefaultCircuitBreakerObservationConvention 定義)。類型 long task timer

在啟動觀察後新增的 KeyValues 可能會從 *.active 指標中遺失。
Micrometer 內部使用 nanoseconds 作為基本單位。但是,每個後端都會決定實際的基本單位。(即 Prometheus 使用秒)

封閉類別的完整限定名稱 org.springframework.cloud.client.circuitbreaker.observation.CircuitBreakerObservationDocumentation

所有標籤都必須以 spring.cloud.circuitbreaker 前綴開頭!
表 1. 低基數鍵

名稱

描述

spring.cloud.circuitbreaker.type (必要)

定義包裝的 lambda 類型。

斷路器供應商觀察

當我們將傳遞給 CircuitBreaker 的 Supplier 包裝時建立的觀察。

指標名稱 spring.cloud.circuitbreaker (由慣例類別 org.springframework.cloud.client.circuitbreaker.observation.DefaultCircuitBreakerObservationConvention 定義)。類型 timer

指標名稱 spring.cloud.circuitbreaker.active (由慣例類別 org.springframework.cloud.client.circuitbreaker.observation.DefaultCircuitBreakerObservationConvention 定義)。類型 long task timer

在啟動觀察後新增的 KeyValues 可能會從 *.active 指標中遺失。
Micrometer 內部使用 nanoseconds 作為基本單位。但是,每個後端都會決定實際的基本單位。(即 Prometheus 使用秒)

封閉類別的完整限定名稱 org.springframework.cloud.client.circuitbreaker.observation.CircuitBreakerObservationDocumentation

所有標籤都必須以 spring.cloud.circuitbreaker 前綴開頭!
表 2. 低基數鍵

名稱

描述

spring.cloud.circuitbreaker.type (必要)

定義包裝的 lambda 類型。

可觀察性 - Span

您可以在下方找到此專案宣告的所有 Span 列表。

斷路器函數觀察 Span

當我們將傳遞給 CircuitBreaker 的 Function 包裝為 fallback 時建立的觀察。

Span 名稱 spring.cloud.circuitbreaker (由慣例類別 org.springframework.cloud.client.circuitbreaker.observation.DefaultCircuitBreakerObservationConvention 定義)。

封閉類別的完整限定名稱 org.springframework.cloud.client.circuitbreaker.observation.CircuitBreakerObservationDocumentation

所有標籤都必須以 spring.cloud.circuitbreaker 前綴開頭!
表 3. 標籤鍵

名稱

描述

spring.cloud.circuitbreaker.type (必要)

定義包裝的 lambda 類型。

斷路器供應商觀察 Span

當我們將傳遞給 CircuitBreaker 的 Supplier 包裝時建立的觀察。

Span 名稱 spring.cloud.circuitbreaker (由慣例類別 org.springframework.cloud.client.circuitbreaker.observation.DefaultCircuitBreakerObservationConvention 定義)。

封閉類別的完整限定名稱 org.springframework.cloud.client.circuitbreaker.observation.CircuitBreakerObservationDocumentation

所有標籤都必須以 spring.cloud.circuitbreaker 前綴開頭!
表 4. 標籤鍵

名稱

描述

spring.cloud.circuitbreaker.type (必要)

定義包裝的 lambda 類型。