View Source otel_resource_detector behaviour (opentelemetry v1.3.0)

Resource detectors are responsible for reading in attributes about the runtime environment of a node (such as an environment variable or some metadata endpoint provided by a cloud host) and returning a otel_resource:t() made from those attributes.

The state machine will spawn a process for each detector and collect the results of running each and merge in the order they are defined. Once in the ready state it will reply to get_resource calls with the final otel_resource:t().

Link to this section Summary

Link to this section Callbacks

-callback get_resource(term()) -> otel_resource:t().

Link to this section Functions

Link to this function

handle_event(_, _, _, Data)

View Source
-spec start_link(Config) -> {ok, pid()} | ignore | {error, term()}
              when
                  Config ::
                      #{resource_detectors := [module()], resource_detector_timeout := integer()}.