クラス OpenTelemetryResourceAttributes

java.lang.ObjectSE
org.springframework.boot.actuate.autoconfigure.opentelemetry.OpenTelemetryResourceAttributes

public final class OpenTelemetryResourceAttributes extends ObjectSE
OpenTelemetryResourceAttributes は、OTEL_RESOURCE_ATTRIBUTES および OTEL_SERVICE_NAME 環境変数から情報を取得し、それをユーザーが提供するリソース属性とマージします。ユーザーが提供するリソース属性が優先されます。さらに、spring.application.* 関連のプロパティをデフォルトとして適用できます。

OpenTelemetry リソース仕様

導入:
3.5.0
作成者:
Dmytro Nosan
  • コンストラクターの詳細

    • OpenTelemetryResourceAttributes

      public OpenTelemetryResourceAttributes(Environment environment, MapSE<StringSE,StringSE> resourceAttributes)
      OpenTelemetryResourceAttributes の新しいインスタンスを作成します。
      パラメーター:
      environment - 環境
      resourceAttributes - user provided resource attributes to be used
  • メソッドの詳細

    • applyTo

      public void applyTo(BiConsumerSE<StringSE,StringSE> consumer)
      環境変数とユーザー定義のリソース属性を組み合わせた後、提供された BiConsumerSE にリソース属性を適用します。

      環境変数とユーザー定義リソースの両方にキーが存在する場合、たとえ空であっても、ユーザー定義リソースの値が優先されます。

      さらに、spring.application.name または unknown_service が service.name のデフォルトとして使用され、spring.application.group が service.group および service.namespace のデフォルトとして機能します。

      パラメーター:
      consumer - 適用する BiConsumerSE