diff --git a/exporters/etw/include/opentelemetry/exporters/etw/etw_logger.h b/exporters/etw/include/opentelemetry/exporters/etw/etw_logger.h index d81eee21d2..494211ea0b 100644 --- a/exporters/etw/include/opentelemetry/exporters/etw/etw_logger.h +++ b/exporters/etw/include/opentelemetry/exporters/etw/etw_logger.h @@ -360,9 +360,10 @@ class LoggerProvider : public opentelemetry::logs::LoggerProvider nostd::shared_ptr GetLogger( 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 + 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); diff --git a/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h b/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h index 5950fb3488..f35b5f11b4 100644 --- a/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h +++ b/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h @@ -412,11 +412,12 @@ class Properties : public opentelemetry::common::KeyValueIterable, public Proper Properties &operator=(const opentelemetry::common::KeyValueIterable &other) { clear(); - other.ForEachKeyValue([&](nostd::string_view key, opentelemetry::common::AttributeValue value) noexcept { - std::string k(key.data(), key.length()); - (*this)[k].FromAttributeValue(value); - return true; - }); + other.ForEachKeyValue( + [&](nostd::string_view key, opentelemetry::common::AttributeValue value) noexcept { + std::string k(key.data(), key.length()); + (*this)[k].FromAttributeValue(value); + return true; + }); return (*this); } @@ -431,8 +432,9 @@ class Properties : public opentelemetry::common::KeyValueIterable, public Proper * the iteration is aborted. * @return true if every key-value pair was iterated over */ - bool ForEachKeyValue(nostd::function_ref - callback) const noexcept override + bool ForEachKeyValue( + nostd::function_ref callback) + const noexcept override { for (const auto &kv : (*this)) { diff --git a/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h b/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h index e87f9483c9..454f6cff5a 100644 --- a/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h +++ b/exporters/etw/include/opentelemetry/exporters/etw/etw_tracer.h @@ -214,16 +214,16 @@ class Tracer : public opentelemetry::trace::Tracer, { size_t idx = 0; std::string linksValue; - links.ForEachKeyValue( - [&](opentelemetry::trace::SpanContext ctx, const opentelemetry::common::KeyValueIterable &) { - if (!linksValue.empty()) - { - linksValue += ','; - linksValue += ToLowerBase16(ctx.span_id()); - } - idx++; - return true; - }); + links.ForEachKeyValue([&](opentelemetry::trace::SpanContext ctx, + const opentelemetry::common::KeyValueIterable &) { + if (!linksValue.empty()) + { + linksValue += ','; + linksValue += ToLowerBase16(ctx.span_id()); + } + idx++; + return true; + }); attributes[ETW_FIELD_SPAN_LINKS] = linksValue; } } @@ -425,8 +425,9 @@ class Tracer : public opentelemetry::trace::Tracer, Properties evtCopy = attributes; return StartSpan(name, evtCopy, links, options); #else // OPENTELEMETRY_RTTI_ENABLED is defined - opentelemetry::common::KeyValueIterable &attribs = const_cast(attributes); - Properties *evt = dynamic_cast(&attribs); + opentelemetry::common::KeyValueIterable &attribs = + const_cast(attributes); + Properties *evt = dynamic_cast(&attribs); if (evt != nullptr) { // Pass as a reference to original modifyable collection without creating a copy @@ -492,7 +493,8 @@ class Tracer : public opentelemetry::trace::Tracer, if (sampling_result.decision == sdk::trace::Decision::DROP) { auto noopSpan = nostd::shared_ptr{ - new (std::nothrow) opentelemetry::trace::NoopSpan(this->shared_from_this(), std::move(spanContext))}; + new (std::nothrow) + opentelemetry::trace::NoopSpan(this->shared_from_this(), std::move(spanContext))}; return noopSpan; } @@ -614,8 +616,9 @@ class Tracer : public opentelemetry::trace::Tracer, Properties evtCopy = attributes; return AddEvent(span, name, timestamp, evtCopy); #else // OPENTELEMETRY_RTTI_ENABLED is defined - opentelemetry::common::KeyValueIterable &attribs = const_cast(attributes); - Properties *evt = dynamic_cast(&attribs); + opentelemetry::common::KeyValueIterable &attribs = + const_cast(attributes); + Properties *evt = dynamic_cast(&attribs); if (evt != nullptr) { // Pass as a reference to original modifyable collection without creating a copy @@ -849,7 +852,8 @@ class Span : public opentelemetry::trace::Span * @param timestamp * @return */ - void AddEvent(nostd::string_view name, opentelemetry::common::SystemTimestamp timestamp) noexcept override + void AddEvent(nostd::string_view name, + opentelemetry::common::SystemTimestamp timestamp) noexcept override { owner_.AddEvent(*this, name, timestamp); } @@ -901,7 +905,8 @@ class Span : public opentelemetry::trace::Span * @param value * @return */ - void SetAttribute(nostd::string_view key, const opentelemetry::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 || diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h index 070188a0cd..76e8856330 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_recordable.h @@ -48,7 +48,8 @@ class OtlpRecordable final : public opentelemetry::sdk::trace::Recordable void AddLink(const opentelemetry::trace::SpanContext &span_context, const opentelemetry::common::KeyValueIterable &attributes) noexcept override; - void SetStatus(opentelemetry::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; diff --git a/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h b/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h index 849f9415e1..35b0dc6863 100644 --- a/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h +++ b/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h @@ -129,7 +129,8 @@ class InstrumentationScope void SetAttribute(nostd::string_view key, const opentelemetry::common::AttributeValue &value) noexcept { - attributes_[std::string(key)] = nostd::visit(opentelemetry::sdk::common::AttributeConverter(), value); + attributes_[std::string(key)] = + nostd::visit(opentelemetry::sdk::common::AttributeConverter(), value); } private: diff --git a/sdk/include/opentelemetry/sdk/trace/span_data.h b/sdk/include/opentelemetry/sdk/trace/span_data.h index ae3d3adf89..ef2c57a092 100644 --- a/sdk/include/opentelemetry/sdk/trace/span_data.h +++ b/sdk/include/opentelemetry/sdk/trace/span_data.h @@ -55,7 +55,8 @@ class SpanDataEvent * Get the attributes for this event * @return the attributes for this event */ - const std::unordered_map &GetAttributes() const noexcept + const std::unordered_map + &GetAttributes() const noexcept { return attribute_map_.GetAttributes(); } @@ -81,7 +82,8 @@ class SpanDataLink * Get the attributes for this link * @return the attributes for this link */ - const std::unordered_map &GetAttributes() const noexcept + const std::unordered_map + &GetAttributes() const noexcept { return attribute_map_.GetAttributes(); } @@ -210,7 +212,8 @@ class SpanData final : public Recordable * Get the attributes for this span * @return the attributes for this span */ - const std::unordered_map &GetAttributes() const noexcept + const std::unordered_map + &GetAttributes() const noexcept { return attribute_map_.GetAttributes(); }