Skip to content

Commit

Permalink
Fix more references to trace/common namespace to be fully qualified
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Dec 2, 2023
1 parent 25343e6 commit 76ca279
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace trace
namespace detail
{
template <class T>
inline void take_span_context_kv(SpanContext, common::KeyValueIterableView<T>)
inline void take_span_context_kv(SpanContext, opentelemetry::common::KeyValueIterableView<T>)
{}

template <class T, nostd::enable_if_t<common::detail::is_key_value_iterable<T>::value> * = nullptr>
Expand Down
12 changes: 6 additions & 6 deletions exporters/etw/include/opentelemetry/exporters/etw/etw_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class Logger : public opentelemetry::logs::Logger
opentelemetry::trace::TraceId trace_id,
opentelemetry::trace::SpanId span_id,
opentelemetry::trace::TraceFlags trace_flags,
common::SystemTimestamp timestamp) noexcept
opentelemetry::common::SystemTimestamp timestamp) noexcept
{
UNREFERENCED_PARAMETER(trace_flags);

Expand Down Expand Up @@ -358,11 +358,11 @@ class LoggerProvider : public opentelemetry::logs::LoggerProvider
}

nostd::shared_ptr<opentelemetry::logs::Logger> GetLogger(
nostd::string_view logger_name,
nostd::string_view library_name,
nostd::string_view version = "",
nostd::string_view schema_url = "",
const common::KeyValueIterable &attributes = common::NoopKeyValueIterable()) override
opentelemetry::nostd::string_view logger_name,
opentelemetry::nostd::string_view library_name,
opentelemetry::nostd::string_view version = "",
opentelemetry::nostd::string_view schema_url = "",
const opentelemetry::common::KeyValueIterable &attributes = opentelemetry::common::NoopKeyValueIterable()) override
{
UNREFERENCED_PARAMETER(library_name);
UNREFERENCED_PARAMETER(version);
Expand Down
50 changes: 25 additions & 25 deletions exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,67 +195,67 @@ class PropertyValue : public PropertyVariant
* @brief Convert non-owning common::AttributeValue to owning PropertyValue.
* @return
*/
PropertyValue &FromAttributeValue(const common::AttributeValue &v)
PropertyValue &FromAttributeValue(const opentelemetry::common::AttributeValue &v)
{
switch (v.index())
{
case common::AttributeType::kTypeBool:
case opentelemetry::common::AttributeType::kTypeBool:
PropertyVariant::operator=(nostd::get<bool>(v));
break;
case common::AttributeType::kTypeInt:
case opentelemetry::common::AttributeType::kTypeInt:
PropertyVariant::operator=(nostd::get<int32_t>(v));
break;
case common::AttributeType::kTypeInt64:
case opentelemetry::common::AttributeType::kTypeInt64:
PropertyVariant::operator=(nostd::get<int64_t>(v));
break;
case common::AttributeType::kTypeUInt:
case opentelemetry::common::AttributeType::kTypeUInt:
PropertyVariant::operator=(nostd::get<uint32_t>(v));
break;
case common::AttributeType::kTypeUInt64:
case opentelemetry::common::AttributeType::kTypeUInt64:
PropertyVariant::operator=(nostd::get<uint64_t>(v));
break;
case common::AttributeType::kTypeDouble:
case opentelemetry::common::AttributeType::kTypeDouble:
PropertyVariant::operator=(nostd::get<double>(v));
break;
case common::AttributeType::kTypeCString: {
case opentelemetry::common::AttributeType::kTypeCString: {
PropertyVariant::operator=(nostd::get<const char *>(v));
break;
}
case common::AttributeType::kTypeString: {
case opentelemetry::common::AttributeType::kTypeString: {
PropertyVariant::operator=
(std::string{nostd::string_view(nostd::get<nostd::string_view>(v)).data()});
break;
}

case common::AttributeType::kTypeSpanByte:
case opentelemetry::common::AttributeType::kTypeSpanByte:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const uint8_t>>(v)));
break;

case common::AttributeType::kTypeSpanBool:
case opentelemetry::common::AttributeType::kTypeSpanBool:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const bool>>(v)));
break;

case common::AttributeType::kTypeSpanInt:
case opentelemetry::common::AttributeType::kTypeSpanInt:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const int32_t>>(v)));
break;

case common::AttributeType::kTypeSpanInt64:
case opentelemetry::common::AttributeType::kTypeSpanInt64:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const int64_t>>(v)));
break;

case common::AttributeType::kTypeSpanUInt:
case opentelemetry::common::AttributeType::kTypeSpanUInt:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const uint32_t>>(v)));
break;

case common::AttributeType::kTypeSpanUInt64:
case opentelemetry::common::AttributeType::kTypeSpanUInt64:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const uint64_t>>(v)));
break;

case common::AttributeType::kTypeSpanDouble:
case opentelemetry::common::AttributeType::kTypeSpanDouble:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const double>>(v)));
break;

case common::AttributeType::kTypeSpanString:
case opentelemetry::common::AttributeType::kTypeSpanString:
PropertyVariant::operator=(to_vector(nostd::get<nostd::span<const nostd::string_view>>(v)));
break;

Expand All @@ -269,9 +269,9 @@ class PropertyValue : public PropertyVariant
* @brief Convert owning PropertyValue to non-owning common::AttributeValue
* @param other
*/
common::AttributeValue ToAttributeValue() const
opentelemetry::common::AttributeValue ToAttributeValue() const
{
common::AttributeValue value;
opentelemetry::common::AttributeValue value;

switch (this->index())
{
Expand Down Expand Up @@ -353,7 +353,7 @@ using PropertyValueMap = std::map<std::string, PropertyValue>;
/**
* @brief Map of PropertyValue with common::KeyValueIterable interface.
*/
class Properties : public common::KeyValueIterable, public PropertyValueMap
class Properties : public opentelemetry::common::KeyValueIterable, public PropertyValueMap
{

/**
Expand Down Expand Up @@ -404,15 +404,15 @@ class Properties : public common::KeyValueIterable, public PropertyValueMap
* container.
*
*/
Properties(const common::KeyValueIterable &other) { (*this) = other; }
Properties(const opentelemetry::common::KeyValueIterable &other) { (*this) = other; }

/**
* @brief PropertyValueMap assignment operator.
*/
Properties &operator=(const common::KeyValueIterable &other)
Properties &operator=(const opentelemetry::common::KeyValueIterable &other)
{
clear();
other.ForEachKeyValue([&](nostd::string_view key, common::AttributeValue value) noexcept {
other.ForEachKeyValue([&](nostd::string_view key, opentelemetry::common::AttributeValue value) noexcept {
std::string k(key.data(), key.length());
(*this)[k].FromAttributeValue(value);
return true;
Expand All @@ -431,12 +431,12 @@ class Properties : public common::KeyValueIterable, public PropertyValueMap
* the iteration is aborted.
* @return true if every key-value pair was iterated over
*/
bool ForEachKeyValue(nostd::function_ref<bool(nostd::string_view, common::AttributeValue)>
bool ForEachKeyValue(nostd::function_ref<bool(nostd::string_view, opentelemetry::common::AttributeValue)>
callback) const noexcept override
{
for (const auto &kv : (*this))
{
const common::AttributeValue &value = kv.second.ToAttributeValue();
const opentelemetry::common::AttributeValue &value = kv.second.ToAttributeValue();
if (!callback(nostd::string_view{kv.first}, value))
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class ETWProvider
}
# if HAVE_TYPE_GUID
// TODO: consider adding UUID/GUID to spec
case common::AttributeType::TYPE_GUID: {
case opentelemetry::common::AttributeType::TYPE_GUID: {
auto temp = nostd::get<GUID>(value);
// TODO: add transform from GUID type to string?
jObj[name] = temp;
Expand Down
50 changes: 25 additions & 25 deletions exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ std::string GetName(T &t)
* @return Span Start timestamp
*/
template <class T>
common::SystemTimestamp GetStartTime(T &t)
opentelemetry::common::SystemTimestamp GetStartTime(T &t)
{
return t.GetStartTime();
}
Expand All @@ -119,7 +119,7 @@ common::SystemTimestamp GetStartTime(T &t)
* @return Span Stop timestamp
*/
template <class T>
common::SystemTimestamp GetEndTime(T &t)
opentelemetry::common::SystemTimestamp GetEndTime(T &t)
{
return t.GetEndTime();
}
Expand Down Expand Up @@ -161,7 +161,7 @@ void UpdateStatus(T &t, Properties &props)
*/

class Tracer : public opentelemetry::trace::Tracer,
public std::enable_shared_from_this<trace::Tracer>
public std::enable_shared_from_this<opentelemetry::trace::Tracer>
{

/**
Expand Down Expand Up @@ -215,7 +215,7 @@ class Tracer : public opentelemetry::trace::Tracer,
size_t idx = 0;
std::string linksValue;
links.ForEachKeyValue(
[&](opentelemetry::trace::SpanContext ctx, const common::KeyValueIterable &) {
[&](opentelemetry::trace::SpanContext ctx, const opentelemetry::common::KeyValueIterable &) {
if (!linksValue.empty())
{
linksValue += ',';
Expand Down Expand Up @@ -414,7 +414,7 @@ class Tracer : public opentelemetry::trace::Tracer,
*/
nostd::shared_ptr<opentelemetry::trace::Span> StartSpan(
nostd::string_view name,
const common::KeyValueIterable &attributes,
const opentelemetry::common::KeyValueIterable &attributes,
const opentelemetry::trace::SpanContextKeyValueIterable &links,
const opentelemetry::trace::StartSpanOptions &options = {}) noexcept override
{
Expand All @@ -425,7 +425,7 @@ class Tracer : public opentelemetry::trace::Tracer,
Properties evtCopy = attributes;
return StartSpan(name, evtCopy, links, options);
#else // OPENTELEMETRY_RTTI_ENABLED is defined
common::KeyValueIterable &attribs = const_cast<common::KeyValueIterable &>(attributes);
opentelemetry::common::KeyValueIterable &attribs = const_cast<opentelemetry::common::KeyValueIterable &>(attributes);
Properties *evt = dynamic_cast<Properties *>(&attribs);
if (evt != nullptr)
{
Expand Down Expand Up @@ -491,8 +491,8 @@ class Tracer : public opentelemetry::trace::Tracer,

if (sampling_result.decision == sdk::trace::Decision::DROP)
{
auto noopSpan = nostd::shared_ptr<trace::Span>{
new (std::nothrow) trace::NoopSpan(this->shared_from_this(), std::move(spanContext))};
auto noopSpan = nostd::shared_ptr<opentelemetry::trace::Span>{
new (std::nothrow) opentelemetry::trace::NoopSpan(this->shared_from_this(), std::move(spanContext))};
return noopSpan;
}

Expand Down Expand Up @@ -602,9 +602,9 @@ class Tracer : public opentelemetry::trace::Tracer,
* @return
*/
void AddEvent(opentelemetry::trace::Span &span,
nostd::string_view name,
common::SystemTimestamp timestamp,
const common::KeyValueIterable &attributes) noexcept
opentelemetry::nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp,
const opentelemetry::common::KeyValueIterable &attributes) noexcept
{
// If RTTI is enabled by compiler, the below code modifies the attributes object passed as arg,
// which is sometime not desirable, set OPENTELEMETRY_NOT_USE_RTTI in application
Expand All @@ -614,7 +614,7 @@ class Tracer : public opentelemetry::trace::Tracer,
Properties evtCopy = attributes;
return AddEvent(span, name, timestamp, evtCopy);
#else // OPENTELEMETRY_RTTI_ENABLED is defined
common::KeyValueIterable &attribs = const_cast<common::KeyValueIterable &>(attributes);
opentelemetry::common::KeyValueIterable &attribs = const_cast<opentelemetry::common::KeyValueIterable &>(attributes);
Properties *evt = dynamic_cast<Properties *>(&attribs);
if (evt != nullptr)
{
Expand All @@ -635,8 +635,8 @@ class Tracer : public opentelemetry::trace::Tracer,
* @return
*/
void AddEvent(opentelemetry::trace::Span &span,
nostd::string_view name,
common::SystemTimestamp timestamp,
opentelemetry::nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp,
Properties &evt) noexcept
{
// TODO: respect originating timestamp. Do we need to reserve
Expand Down Expand Up @@ -693,8 +693,8 @@ class Tracer : public opentelemetry::trace::Tracer,
* @return
*/
void AddEvent(opentelemetry::trace::Span &span,
nostd::string_view name,
common::SystemTimestamp timestamp) noexcept
opentelemetry::nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp) noexcept
{
AddEvent(span, name, timestamp, sdk::GetEmptyAttributes());
}
Expand Down Expand Up @@ -728,8 +728,8 @@ class Span : public opentelemetry::trace::Span
*/
Properties attributes_;

common::SystemTimestamp start_time_;
common::SystemTimestamp end_time_;
opentelemetry::common::SystemTimestamp start_time_;
opentelemetry::common::SystemTimestamp end_time_;

opentelemetry::trace::StatusCode status_code_{opentelemetry::trace::StatusCode::kUnset};
std::string status_description_;
Expand Down Expand Up @@ -794,13 +794,13 @@ class Span : public opentelemetry::trace::Span
* @brief Get start time of this Span.
* @return
*/
common::SystemTimestamp GetStartTime() { return start_time_; }
opentelemetry::common::SystemTimestamp GetStartTime() { return start_time_; }

/**
* @brief Get end time of this Span.
* @return
*/
common::SystemTimestamp GetEndTime() { return end_time_; }
opentelemetry::common::SystemTimestamp GetEndTime() { return end_time_; }

/**
* @brief Get Span Name.
Expand Down Expand Up @@ -849,7 +849,7 @@ class Span : public opentelemetry::trace::Span
* @param timestamp
* @return
*/
void AddEvent(nostd::string_view name, common::SystemTimestamp timestamp) noexcept override
void AddEvent(nostd::string_view name, opentelemetry::common::SystemTimestamp timestamp) noexcept override
{
owner_.AddEvent(*this, name, timestamp);
}
Expand All @@ -861,9 +861,9 @@ class Span : public opentelemetry::trace::Span
* @param attributes Event attributes.
* @return
*/
void AddEvent(nostd::string_view name,
common::SystemTimestamp timestamp,
const common::KeyValueIterable &attributes) noexcept override
void AddEvent(opentelemetry::nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp,
const opentelemetry::common::KeyValueIterable &attributes) noexcept override
{
owner_.AddEvent(*this, name, timestamp, attributes);
}
Expand Down Expand Up @@ -901,7 +901,7 @@ class Span : public opentelemetry::trace::Span
* @param value
* @return
*/
void SetAttribute(nostd::string_view key, const common::AttributeValue &value) noexcept override
void SetAttribute(nostd::string_view key, const opentelemetry::common::AttributeValue &value) noexcept override
{
// don't override fields propagated from span data.
if (key == ETW_FIELD_NAME || key == ETW_FIELD_SPAN_ID || key == ETW_FIELD_TRACE_ID ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ class OtlpRecordable final : public opentelemetry::sdk::trace::Recordable
void SetIdentity(const opentelemetry::trace::SpanContext &span_context,
opentelemetry::trace::SpanId parent_span_id) noexcept override;

void SetAttribute(nostd::string_view key,
void SetAttribute(opentelemetry::nostd::string_view key,
const opentelemetry::common::AttributeValue &value) noexcept override;

void AddEvent(nostd::string_view name,
common::SystemTimestamp timestamp,
const common::KeyValueIterable &attributes) noexcept override;
void AddEvent(opentelemetry::nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp,
const opentelemetry::common::KeyValueIterable &attributes) noexcept override;

void AddLink(const opentelemetry::trace::SpanContext &span_context,
const common::KeyValueIterable &attributes) noexcept override;
const opentelemetry::common::KeyValueIterable &attributes) noexcept override;

void SetStatus(trace::StatusCode code, nostd::string_view description) noexcept override;
void SetStatus(opentelemetry::trace::StatusCode code, nostd::string_view description) noexcept override;

void SetName(nostd::string_view name) noexcept override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class Recordable final : public sdk::trace::Recordable
void SetIdentity(const opentelemetry::trace::SpanContext &span_context,
opentelemetry::trace::SpanId parent_span_id) noexcept override;

void SetAttribute(nostd::string_view key,
void SetAttribute(opentelemetry::nostd::string_view key,
const opentelemetry::common::AttributeValue &value) noexcept override;

void AddEvent(nostd::string_view name,
common::SystemTimestamp timestamp,
const common::KeyValueIterable &attributes) noexcept override;
void AddEvent(opentelemetry::nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp,
const opentelemetry::common::KeyValueIterable &attributes) noexcept override;

void AddLink(const opentelemetry::trace::SpanContext &span_context,
const common::KeyValueIterable &attributes) noexcept override;
const opentelemetry::common::KeyValueIterable &attributes) noexcept override;

void SetStatus(opentelemetry::trace::StatusCode code,
nostd::string_view description) noexcept override;
Expand Down
Loading

0 comments on commit 76ca279

Please sign in to comment.