@Immutable public abstract class Resource extends Object
Resource represents a resource, which capture identifying information about the entities
for which signals (stats or traces) are reported.| Modifier and Type | Method and Description |
|---|---|
static Resource |
create(Map<String,String> labels)
Returns a
Resource. |
static Resource |
getEmpty() |
abstract Map<String,String> |
getLabels()
Returns a map of labels that describe the resource.
|
Resource |
merge(Resource other)
|
public static Resource getEmpty()
public abstract Map<String,String> getLabels()
public static Resource create(Map<String,String> labels)
Resource.labels - a map of labels that describe the resource.Resource.NullPointerException - if labels is null.IllegalArgumentException - if label key or label value is not a valid printable ASCII
string or exceed MAX_LENGTH characters.public Resource merge(@Nullable Resource other)
Resource by merging the current Resource with the other Resource. In case of a collision, current Resource takes precedence.other - the Resource that will be merged with this.Resource.