Class ResourceBuilder
- java.lang.Object
-
- io.opentelemetry.sdk.resources.ResourceBuilder
-
-
Constructor Summary
Constructors Constructor Description ResourceBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
build()
Create theResource
from this.ResourceBuilder
put(io.opentelemetry.api.common.AttributeKey<java.lang.Long> key, int value)
Puts aAttributeKey
with associated value into this.<T> ResourceBuilder
put(io.opentelemetry.api.common.AttributeKey<T> key, T value)
Puts aAttributeKey
with associated value into this.ResourceBuilder
put(java.lang.String key, boolean value)
Puts a boolean attribute into this.ResourceBuilder
put(java.lang.String key, boolean... values)
Puts a Boolean array attribute into this.ResourceBuilder
put(java.lang.String key, double value)
Puts a double attribute into this.ResourceBuilder
put(java.lang.String key, double... values)
Puts a Double array attribute into this.ResourceBuilder
put(java.lang.String key, long value)
Puts a long attribute into this.ResourceBuilder
put(java.lang.String key, long... values)
Puts a Long array attribute into this.ResourceBuilder
put(java.lang.String key, java.lang.String value)
Puts a String attribute into this.ResourceBuilder
put(java.lang.String key, java.lang.String... values)
Puts a String array attribute into this.ResourceBuilder
putAll(io.opentelemetry.api.common.Attributes attributes)
Puts allAttributes
into this.ResourceBuilder
putAll(Resource resource)
Puts all attributes fromResource
into this.
-
-
-
Method Detail
-
put
public ResourceBuilder put(java.lang.String key, java.lang.String value)
Puts a String attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, long value)
Puts a long attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, double value)
Puts a double attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, boolean value)
Puts a boolean attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, java.lang.String... values)
Puts a String array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, long... values)
Puts a Long array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, double... values)
Puts a Double array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public ResourceBuilder put(java.lang.String key, boolean... values)
Puts a Boolean array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
public <T> ResourceBuilder put(io.opentelemetry.api.common.AttributeKey<T> key, T value)
Puts aAttributeKey
with associated value into this.
-
put
public ResourceBuilder put(io.opentelemetry.api.common.AttributeKey<java.lang.Long> key, int value)
Puts aAttributeKey
with associated value into this.
-
putAll
public ResourceBuilder putAll(io.opentelemetry.api.common.Attributes attributes)
Puts allAttributes
into this.
-
putAll
public ResourceBuilder putAll(Resource resource)
Puts all attributes fromResource
into this.
-
-