Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace logs
{

/**
* Struct to hold batch SpanProcessor options.
* Struct to hold batch LogRecordProcessor options.
*/
struct BatchLogRecordProcessorOptions
{
Expand Down
21 changes: 8 additions & 13 deletions sdk/include/opentelemetry/sdk/resource/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ using ResourceAttributes = opentelemetry::sdk::common::AttributeMap;
class Resource
{
public:
Resource(const Resource &) = default;
Resource() noexcept;

Resource(const ResourceAttributes &attributes) noexcept;

Resource(const ResourceAttributes &attributes, const std::string &schema_url) noexcept;

Resource(const Resource &) = default;
Resource &operator=(const Resource &) = default;

const ResourceAttributes &GetAttributes() const noexcept;
const std::string &GetSchemaURL() const noexcept;
Expand Down Expand Up @@ -61,21 +68,9 @@ class Resource

static Resource &GetDefault();

protected:
/**
* The constructor is protected and only for use internally by the class and
* inside ResourceDetector class.
* Users should use the Create factory method to obtain a Resource
* instance.
*/
Resource(const ResourceAttributes &attributes = ResourceAttributes(),
const std::string &schema_url = std::string{}) noexcept;

private:
ResourceAttributes attributes_;
std::string schema_url_;

friend class ResourceDetector;
};

} // namespace resource
Expand Down
6 changes: 6 additions & 0 deletions sdk/src/resource/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ namespace sdk
namespace resource
{

Resource::Resource() noexcept : attributes_(), schema_url_() {}

Resource::Resource(const ResourceAttributes &attributes) noexcept
: attributes_(attributes), schema_url_()
{}

Resource::Resource(const ResourceAttributes &attributes, const std::string &schema_url) noexcept
: attributes_(attributes), schema_url_(schema_url)
{}
Expand Down
Loading