付録 A: 共通のアプリケーションプロパティ

application.properties ファイル、application.yml ファイル、コマンドラインスイッチとして、さまざまなプロパティを指定したり環境別に切り替えたりできます。この付録では、一般的な Spring Cloud Commons プロパティの一覧と、使用する基になるクラスへの参照を提供します。なお、プロパティ名はバージョンアップ時に変更される場合があるため、使用している Spring Boot バージョンのドキュメントを参照してください。

プロパティのコントリビュートは、クラスパス上の追加の jar ファイルから得られる可能性があるため、これを完全な一覧と見なすべきではありません。また、独自のプロパティを定義できます。
名前 デフォルト 説明

spring.cloud.compatibility-verifier.compatible-boot-versions

Spring Boot 依存関係のデフォルトで受け入れられるバージョン。具体的な値を指定したくない場合は、パッチバージョンに {@code x} を設定できます。例: {@ コード 3.4.x}

spring.cloud.compatibility-verifier.enabled

false

Spring Cloud 互換性検証の作成を有効にします。

spring.cloud.config.allow-override

true

{@link #isOverrideSystemProperties()systemPropertiesOverride} を使用できることを示すフラグ。ユーザーが誤ってデフォルトを変更しないようにするには、false に設定します。デフォルトは true です。

spring.cloud.config.initialize-on-context-refresh

false

コンテキストリフレッシュイベントでブートストラップ構成を初期化するフラグ。デフォルトは false。

spring.cloud.config.override-none

false

{@link #setAllowOverride(boolean) allowedOverride} が true の場合、外部プロパティの優先順位が最も低くなり、既存のプロパティソース (ローカル構成ファイルを含む) をオーバーライドしてはならないことを示すフラグ。デフォルトは false。これは、config first bootstrap を使用する場合にのみ効果があります。

spring.cloud.config.override-system-properties

true

外部プロパティがシステムプロパティをオーバーライドする必要があることを示すフラグ。デフォルトは true です。

spring.cloud.decrypt-environment-post-processor.enabled

true

DecryptEnvironmentPostProcessor を有効にします。

spring.cloud.discovery.client.composite-indicator.enabled

true

ディスカバリクライアントの複合ヘルスインジケータを有効にします。

spring.cloud.discovery.client.health-indicator.enabled

true

spring.cloud.discovery.client.health-indicator.include-description

false

spring.cloud.discovery.client.health-indicator.use-services-query

true

インジケーターがそのヘルスをチェックするために {@ linkDiscoveryClient#getServices} を使用する必要があるかどうか。{@code false} に設定すると、インジケーターは代わりにライターの {@link DiscoveryClient#probe()} を使用します。これは、返されるサービスの数によって操作が不必要に重くなる大規模なデプロイで役立ちます。

spring.cloud.discovery.client.simple.instances

spring.cloud.discovery.client.simple.local.host

spring.cloud.discovery.client.simple.local.instance-id

spring.cloud.discovery.client.simple.local.metadata

spring.cloud.discovery.client.simple.local.port

0

spring.cloud.discovery.client.simple.local.secure

false

spring.cloud.discovery.client.simple.local.service-id

spring.cloud.discovery.client.simple.local.uri

spring.cloud.discovery.client.simple.order

spring.cloud.discovery.enabled

true

ディスカバリクライアントのヘルスインジケータを有効にします。

spring.cloud.features.enabled

true

関数エンドポイントを有効にします。

spring.cloud.httpclientfactories.apache.enabled

true

Apache Http クライアントファクトリ Bean の作成を有効にします。

spring.cloud.httpclientfactories.ok.enabled

true

OKHttp クライアントファクトリ Bean の作成を有効にします。

spring.cloud.hypermedia.refresh.fixed-delay

5000

spring.cloud.hypermedia.refresh.initial-delay

10000

spring.cloud.inetutils.default-hostname

localhost

デフォルトのホスト名。エラーの場合に使用されます。

spring.cloud.inetutils.default-ip-address

127.0.0.1

デフォルトの IP アドレス。エラーの場合に使用されます。

spring.cloud.inetutils.ignored-interfaces

無視されるネットワークインターフェースの Java 正規表現のリスト。

spring.cloud.inetutils.preferred-networks

優先されるネットワークアドレスの Java 正規表現のリスト。

spring.cloud.inetutils.timeout-seconds

1

ホスト名を計算するためのタイムアウト(秒単位)。

spring.cloud.inetutils.use-only-site-local-interfaces

false

サイトのローカルアドレスを持つインターフェースのみを使用するかどうか。詳細については、{@ link InetAddress#isSiteLocalAddress()} を参照してください。

spring.cloud.loadbalancer.cache.caffeine.spec

キャッシュの作成に使用する仕様。スペック形式の詳細については、CaffeineSpec を参照してください。

spring.cloud.loadbalancer.cache.capacity

256

int として表される初期キャッシュ容量。

spring.cloud.loadbalancer.cache.enabled

true

Spring Cloud LoadBalancer キャッシュメカニズムを有効にします。

spring.cloud.loadbalancer.cache.ttl

35s

有効期間 - レコードの書き込みからカウントされ、その後キャッシュエントリが期限切れになるまでの時間。

spring.cloud.loadbalancer.call-get-with-request-on-delegates

false

このフラグが {@code true} に設定されている場合、{@code ServiceInstanceListSupplier#get(Request request)} メソッドが実装され、{@code DelegatingServiceInstanceListSupplier} から割り当て可能なクラスでそのメソッドをまだ実装していない場合に {@code delegate.get(request)} が呼び出されます。ただし、{@code CachingServiceInstanceListSupplier} と {@code HealthCheckServiceInstanceListSupplier} は除外されます。これらのクラスは、リクエストベースのフィルタリングが行われる前に、ネットワーク経由でインスタンスの取得を実行するサプライヤーの直後にインスタンスサプライヤー階層に配置する必要があります。注: 4.1 では、この動作がデフォルトになります。

spring.cloud.loadbalancer.clients

spring.cloud.loadbalancer.configurations

default

事前定義された LoadBalancer 構成を有効にします。

spring.cloud.loadbalancer.eager-load.clients

クライアントの名前。

spring.cloud.loadbalancer.enabled

true

Spring Cloud LoadBalancer を有効にします。

spring.cloud.loadbalancer.health-check.initial-delay

0

HealthCheck スケジューラーの初期遅延値。

spring.cloud.loadbalancer.health-check.interval

25s

HealthCheck スケジューラーを再実行するための間隔。

spring.cloud.loadbalancer.health-check.interval

25s

HealthCheck スケジューラーを再実行するための間隔。

spring.cloud.loadbalancer.health-check.path

ヘルスチェックリクエストを行うパス。serviceId ごとに設定可能。default 値も設定できます。何も設定されていない場合は、/actuator/health が使用されます。

spring.cloud.loadbalancer.health-check.port

ヘルスチェックリクエストを行う必要があるパス。何も設定されていない場合、リクエストされたサービスがサービスインスタンスで利用できるポート。

spring.cloud.loadbalancer.health-check.refetch-instances

false

HealthCheckServiceInstanceListSupplier によってインスタンスを再フェッチする必要があるかどうかを示します。これは、インスタンスが更新でき、基になるデリゲートが継続的なフラックスを提供しない場合に使用できます。

spring.cloud.loadbalancer.health-check.refetch-instances-interval

25s

使用可能なサービスインスタンスを再フェッチする間隔。

spring.cloud.loadbalancer.health-check.repeat-health-check

true

ヘルスチェックを繰り返し続ける必要があるかどうかを示します。インスタンスを定期的に再フェッチする場合は、再フェッチのたびにヘルスチェックもトリガーされるため、これを false に設定すると便利な場合があります。

spring.cloud.loadbalancer.health-check.update-results-list

true

取得された有効な {@link ServiceInstance} ごとに {@code healthCheckFlux} を発行するかどうかを示します。{@code false} に設定すると、アライブインスタンスシーケンス全体が最初にリストに収集されてから出力されます。

spring.cloud.loadbalancer.hint

<code>hint</code> の値を設定できます。</code> that is passed on to the LoadBalancer request and can subsequently be used in {@link ReactiveLoadBalancer} implementations.

spring.cloud.loadbalancer.hint-header-name

X-SC-LB-Hint

ヒントベースのサービスインスタンスフィルタリングのヒントを渡すために使用されるヘッダーの名前を設定できます。

spring.cloud.loadbalancer.retry.avoid-previous-instance

true

Spring-Retry がクラスパスにある場合、ServiceInstanceListSupplier Bean を RetryAwareServiceInstanceListSupplier でラップできるようにします。

spring.cloud.loadbalancer.retry.backoff.enabled

false

Reactor 再試行バックオフを適用する必要があるかどうかを示します。

spring.cloud.loadbalancer.retry.backoff.jitter

0.5

RetryBackoffSpec.jitter の設定に使用します。

spring.cloud.loadbalancer.retry.backoff.max-backoff

Long.MAX ms

RetryBackoffSpec.maxBackoff の設定に使用します。

spring.cloud.loadbalancer.retry.backoff.min-backoff

5 ms

RetryBackoffSpec#minBackoff の設定に使用します。

spring.cloud.loadbalancer.retry.enabled

true

LoadBalancer の再試行を有効にします。

spring.cloud.loadbalancer.retry.max-retries-on-next-service-instance

1

次の ServiceInstance で実行される再試行の数。ServiceInstance は、各再試行呼び出しの前に選択されます。

spring.cloud.loadbalancer.retry.max-retries-on-same-service-instance

0

同じ ServiceInstance 上で実行される再試行の数。

spring.cloud.loadbalancer.retry.retry-on-all-exceptions

false

retryableExceptions で指定された例外だけでなく、すべての例外に対して再試行する必要があることを示します。

spring.cloud.loadbalancer.retry.retry-on-all-operations

false

HttpMethod.GET 以外の操作で再試行する必要があることを示します。

spring.cloud.loadbalancer.retry.retryable-exceptions

{}

再試行をトリガーする必要がある Throwable クラスの Set

spring.cloud.loadbalancer.retry.retryable-status-codes

{}

再試行をトリガーするステータスコードの Set

spring.cloud.loadbalancer.service-discovery.timeout

サービスディスカバリへの呼び出しのタイムアウトの期間の文字列表現。

spring.cloud.loadbalancer.stats.micrometer.enabled

false

Spring Cloud LoadBalancer Micrometer 統計を有効にします。

spring.cloud.loadbalancer.sticky-session.add-service-instance-cookie

false

新しく選択されたインスタンスを含む Cookie を LoadBalancer で追加する必要があるかどうかを示します。

spring.cloud.loadbalancer.sticky-session.instance-id-cookie-name

sc-lb-instance-id

優先インスタンス ID を保持する Cookie の名前。

spring.cloud.loadbalancer.x-forwarded.enabled

false

X-Forwarded ヘッダーを有効にします。

spring.cloud.loadbalancer.zone

Spring Cloud LoadBalancer ゾーン。

spring.cloud.refresh.additional-property-sources-to-retain

リフレッシュ中に保持する追加のプロパティソース。通常、システムプロパティソースのみが保持されます。このプロパティを使用すると、EnvironmentPostProcessors によって作成されたプロパティソースなどのプロパティソースも保持できます。

spring.cloud.refresh.enabled

true

リフレッシュスコープと関連機能の自動構成を有効にします。

spring.cloud.refresh.extra-refreshable

true

後処理をリフレッシュスコープに入れる Bean の追加のクラス名。

spring.cloud.refresh.never-refreshable

true

Bean のクラス名のコンマ区切りリストは、リフレッシュまたはリバウンドされません。

spring.cloud.service-registry.auto-registration.enabled

true

サービスの自動登録が有効になっているかどうか。デフォルトは true です。

spring.cloud.service-registry.auto-registration.fail-fast

false

AutoServiceRegistration がない場合に起動に失敗するかどうか。デフォルトは false です。

spring.cloud.service-registry.auto-registration.register-management

true

管理をサービスとして登録するかどうか。デフォルトは true です。

spring.cloud.util.enabled

true

Spring Cloud ユーティリティ Bean の作成を有効にします。

1. 可観測性メタデータ

1.1. 可観測性 - メトリクス

以下に、このプロジェクトで宣言されたすべての指標のリストを示します。

1.1.1. サーキットブレーカー機能の監視

フォールバックとして CircuitBreaker に渡される関数をラップするときに作成されたオブザベーション。

指標名  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 (必須)

ラップされたラムダの型を定義します。

1.1.2. サーキットブレーカーサプライヤーの監視

CircuitBreaker に渡されたサプライヤーをラップするときに作成されたオブザベーション。

指標名  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 (必須)

ラップされたラムダの型を定義します。

1.2. 可観測性 - スパン

以下に、このプロジェクトで宣言されたすべてのスパンのリストを示します。

1.2.1. サーキットブレーカー機能の観測期間

フォールバックとして CircuitBreaker に渡される関数をラップするときに作成されたオブザベーション。

スパン名  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 (必須)

ラップされたラムダの型を定義します。

1.2.2. サーキットブレーカーサプライヤーの観測期間

CircuitBreaker に渡されたサプライヤーをラップするときに作成されたオブザベーション。

スパン名  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 (必須)

ラップされたラムダの型を定義します。