クラス OpenTelemetryResourceAttributes
java.lang.ObjectSE
org.springframework.boot.opentelemetry.autoconfigure.OpenTelemetryResourceAttributes
OpenTelemetryResourceAttributes は、OTEL_RESOURCE_ATTRIBUTES および OTEL_SERVICE_NAME 環境変数から情報を取得し、それをユーザーが提供するリソース属性とマージします。ユーザーが提供するリソース属性が優先されます。さらに、spring.application.* 関連のプロパティをデフォルトとして適用できます。- 導入:
- 4.0.0
- 作成者:
- Dmytro Nosan
コンストラクターの概要
コンストラクターコンストラクター説明OpenTelemetryResourceAttributes(Environment environment, @Nullable MapSE<StringSE, StringSE> resourceAttributes) OpenTelemetryResourceAttributesの新しいインスタンスを作成します。方法の概要
修飾子と型メソッド説明voidapplyTo(BiConsumerSE<StringSE, StringSE> consumer) 環境変数とユーザー定義のリソース属性を組み合わせた後、提供されたBiConsumerSE にリソース属性を適用します。
コンストラクターの詳細
OpenTelemetryResourceAttributes
public OpenTelemetryResourceAttributes(Environment environment, @Nullable MapSE<StringSE, StringSE> resourceAttributes) OpenTelemetryResourceAttributesの新しいインスタンスを作成します。- パラメーター:
environment- 環境resourceAttributes- 使用されるユーザー提供のリソース属性
メソッドの詳細
applyTo
環境変数とユーザー定義のリソース属性を組み合わせた後、提供されたBiConsumerSE にリソース属性を適用します。環境変数とユーザー定義リソースの両方にキーが存在する場合、たとえ空であっても、ユーザー定義リソースの値が優先されます。
さらに、
spring.application.nameまたはunknown_serviceがservice.nameのデフォルトとして使用され、spring.application.groupがservice.groupおよびservice.namespaceのデフォルトとして機能します。- パラメーター:
consumer- 適用するBiConsumerSE