类 OpenTelemetryResourceAttributes
java.lang.Object
org.springframework.boot.actuate.autoconfigure.opentelemetry.OpenTelemetryResourceAttributes
OpenTelemetryResourceAttributes
retrieves information from the
OTEL_RESOURCE_ATTRIBUTES
and OTEL_SERVICE_NAME
environment variables
and merges it with the resource attributes provided by the user. User-provided resource
attributes take precedence. Additionally, spring.application.*
related
properties can be applied as defaults.
- 从以下版本开始:
- 3.5.0
- 作者:
- Dmytro Nosan
-
构造器概要
构造器构造器说明OpenTelemetryResourceAttributes
(Environment environment, Map<String, String> resourceAttributes) Creates a new instance ofOpenTelemetryResourceAttributes
. -
方法概要
修饰符和类型方法说明void
applyTo
(BiConsumer<String, String> consumer) Applies resource attributes to the providedBiConsumer
after being combined from environment variables and user-defined resource attributes.
-
构造器详细资料
-
OpenTelemetryResourceAttributes
public OpenTelemetryResourceAttributes(Environment environment, Map<String, String> resourceAttributes) Creates a new instance ofOpenTelemetryResourceAttributes
.- 参数:
environment
- the environmentresourceAttributes
- user-provided resource attributes to be used
-
-
方法详细资料
-
applyTo
Applies resource attributes to the providedBiConsumer
after being combined from environment variables and user-defined resource attributes.If a key exists in both environment variables and user-defined resources, the value from the user-defined resource takes precedence, even if it is empty.
Additionally,
spring.application.name
orunknown_service
will be used as the default forservice.name
, andspring.application.group
will serve as the default forservice.group
andservice.namespace
.- 参数:
consumer
- theBiConsumer
to apply
-