Skip to content

Commit f28ea95

Browse files
authored
[CONFIGURATION] File configuration - sdk resource (open-telemetry#3567)
1 parent dbd0680 commit f28ea95

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

sdk/include/opentelemetry/sdk/logs/batch_log_record_processor_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace logs
1616
{
1717

1818
/**
19-
* Struct to hold batch SpanProcessor options.
19+
* Struct to hold batch LogRecordProcessor options.
2020
*/
2121
struct BatchLogRecordProcessorOptions
2222
{

sdk/include/opentelemetry/sdk/resource/resource.h

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ using ResourceAttributes = opentelemetry::sdk::common::AttributeMap;
1919
class Resource
2020
{
2121
public:
22-
Resource(const Resource &) = default;
22+
Resource() noexcept;
23+
24+
Resource(const ResourceAttributes &attributes) noexcept;
25+
26+
Resource(const ResourceAttributes &attributes, const std::string &schema_url) noexcept;
27+
28+
Resource(const Resource &) = default;
29+
Resource &operator=(const Resource &) = default;
2330

2431
const ResourceAttributes &GetAttributes() const noexcept;
2532
const std::string &GetSchemaURL() const noexcept;
@@ -61,21 +68,9 @@ class Resource
6168

6269
static Resource &GetDefault();
6370

64-
protected:
65-
/**
66-
* The constructor is protected and only for use internally by the class and
67-
* inside ResourceDetector class.
68-
* Users should use the Create factory method to obtain a Resource
69-
* instance.
70-
*/
71-
Resource(const ResourceAttributes &attributes = ResourceAttributes(),
72-
const std::string &schema_url = std::string{}) noexcept;
73-
7471
private:
7572
ResourceAttributes attributes_;
7673
std::string schema_url_;
77-
78-
friend class ResourceDetector;
7974
};
8075

8176
} // namespace resource

sdk/src/resource/resource.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ namespace sdk
2020
namespace resource
2121
{
2222

23+
Resource::Resource() noexcept : attributes_(), schema_url_() {}
24+
25+
Resource::Resource(const ResourceAttributes &attributes) noexcept
26+
: attributes_(attributes), schema_url_()
27+
{}
28+
2329
Resource::Resource(const ResourceAttributes &attributes, const std::string &schema_url) noexcept
2430
: attributes_(attributes), schema_url_(schema_url)
2531
{}

0 commit comments

Comments
 (0)