View Source otel_resource (opentelemetry v1.5.0)
A Resource is attributes representing the entity producing telemetry. For example, by default the language (Erlang), name of this library (opentelemetry
), and version of this library are included in the Resource.
This module provides the functional interface for working with the resource record.
The opentelemetry
library supports resource detectors to detect attributes to include in the Resource. See otel_resource_detector
for the behaviour to detect resources, and the otel_resource_app_env
and otel_resource_env_var
modules for built-in implementations.
Summary
Types
Functions
Returns the attributes of the given Resource
.
Equivalent to create(Attributes, undefined).
Creates a new resources from the given map or list of Attributes
and with the given SchemaUrl
.
true
if Key
is valid and part of the given resource.Merges the two given resources.
Types
-type key() :: unicode:latin1_binary() | atom().
-type schema_url() :: uri_string:uri_string().
-type t() :: #resource{schema_url :: schema_url() | undefined, attributes :: otel_attributes:t()} | undefined.
-type value() :: unicode:latin1_binary() | integer() | float() | boolean().
Functions
-spec attributes(t()) -> otel_attributes:t() | undefined.
Returns the attributes of the given Resource
.
undefined
only in case Resource
is an invalid argument (not a resource record).
Equivalent to create(Attributes, undefined).
Creates a new resources from the given map or list of Attributes
and with the given SchemaUrl
.
true
if Key
is valid and part of the given resource.
Merges the two given resources.
In case of collision, the first argument (Resource
) takes precedence.
-spec schema_url(t()) -> schema_url() | undefined.