diff --git a/CHANGELOG.md b/CHANGELOG.md index 04b1603c3c..6d8ca3317f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,11 @@ Important changes: * Upgrade to prometheus 1.3.0 [#3122](https://github.com/open-telemetry/opentelemetry-cpp/pull/3122) +* [EXPORTER] Change log resources location for ElasticsearchLogRecordExporter + [#3119](https://github.com/open-telemetry/opentelemetry-cpp/pull/3131) + + * Moved from `root/resources` to `root` + ## [1.17 2024-10-07] * [CI] Add a clang-tidy build diff --git a/api/include/opentelemetry/common/spin_lock_mutex.h b/api/include/opentelemetry/common/spin_lock_mutex.h index 369183b953..7031fa4d23 100644 --- a/api/include/opentelemetry/common/spin_lock_mutex.h +++ b/api/include/opentelemetry/common/spin_lock_mutex.h @@ -68,8 +68,10 @@ class SpinLockMutex # else __builtin_ia32_pause(); # endif -#elif defined(__arm__) - __asm__ volatile("yield" ::: "memory"); +#elif defined(__armel__) || defined(__ARMEL__) + asm volatile("nop" ::: "memory"); +#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64 + __asm__ __volatile__("yield" ::: "memory"); #else // TODO: Issue PAGE/YIELD on other architectures. #endif diff --git a/api/include/opentelemetry/logs/event_logger.h b/api/include/opentelemetry/logs/event_logger.h index b5c94a7067..d3049953bc 100644 --- a/api/include/opentelemetry/logs/event_logger.h +++ b/api/include/opentelemetry/logs/event_logger.h @@ -65,9 +65,8 @@ class EventLogger } nostd::unique_ptr log_record = delegate_logger->CreateLogRecord(); - IgnoreTraitResult( - detail::LogRecordSetterTrait::type>::template Set( - log_record.get(), std::forward(args))...); + IgnoreTraitResult(detail::LogRecordSetterTrait::type>::Set( + log_record.get(), std::forward(args))...); EmitEvent(event_name, std::move(log_record)); } diff --git a/api/include/opentelemetry/logs/logger.h b/api/include/opentelemetry/logs/logger.h index dc09a0c2b4..519516f297 100644 --- a/api/include/opentelemetry/logs/logger.h +++ b/api/include/opentelemetry/logs/logger.h @@ -72,9 +72,8 @@ class Logger return; } - IgnoreTraitResult( - detail::LogRecordSetterTrait::type>::template Set( - log_record.get(), std::forward(args))...); + IgnoreTraitResult(detail::LogRecordSetterTrait::type>::Set( + log_record.get(), std::forward(args))...); EmitLogRecord(std::move(log_record)); } diff --git a/api/include/opentelemetry/logs/logger_type_traits.h b/api/include/opentelemetry/logs/logger_type_traits.h index 486135137d..d88a6ffbdc 100644 --- a/api/include/opentelemetry/logs/logger_type_traits.h +++ b/api/include/opentelemetry/logs/logger_type_traits.h @@ -166,8 +166,8 @@ struct LogRecordSetterTrait * = nullptr> inline static LogRecord *Set(LogRecord *log_record, ArgumentType &&arg) noexcept { - return LogRecordSetterTrait::template Set( - log_record, std::forward(arg)); + return LogRecordSetterTrait::Set(log_record, + std::forward(arg)); } template (value) ? true : false; - return; - case common::AttributeType::kTypeInt: - json_[name][key.data()] = opentelemetry::nostd::get(value); - return; - case common::AttributeType::kTypeInt64: - json_[name][key.data()] = opentelemetry::nostd::get(value); - return; - case common::AttributeType::kTypeUInt: - json_[name][key.data()] = opentelemetry::nostd::get(value); - return; - case common::AttributeType::kTypeUInt64: - json_[name][key.data()] = opentelemetry::nostd::get(value); - return; - case common::AttributeType::kTypeDouble: - json_[name][key.data()] = opentelemetry::nostd::get(value); - return; - case common::AttributeType::kTypeCString: - json_[name][key.data()] = opentelemetry::nostd::get(value); - return; - case common::AttributeType::kTypeString: - json_[name][key.data()] = - opentelemetry::nostd::get(value).data(); - return; - default: - return; - } -} - -void ElasticSearchRecordable::WriteKeyValue( - nostd::string_view key, +void ElasticSearchRecordable::WriteValue( const opentelemetry::sdk::common::OwnedAttributeValue &value, const std::string &name) { @@ -59,25 +22,25 @@ void ElasticSearchRecordable::WriteKeyValue( switch (value.index()) { case common::kTypeBool: - json_[name][key.data()] = opentelemetry::nostd::get(value) ? true : false; + json_[name] = opentelemetry::nostd::get(value) ? true : false; return; case common::kTypeInt: - json_[name][key.data()] = opentelemetry::nostd::get(value); + json_[name] = opentelemetry::nostd::get(value); return; case common::kTypeInt64: - json_[name][key.data()] = opentelemetry::nostd::get(value); + json_[name] = opentelemetry::nostd::get(value); return; case common::kTypeUInt: - json_[name][key.data()] = opentelemetry::nostd::get(value); + json_[name] = opentelemetry::nostd::get(value); return; case common::kTypeUInt64: - json_[name][key.data()] = opentelemetry::nostd::get(value); + json_[name] = opentelemetry::nostd::get(value); return; case common::kTypeDouble: - json_[name][key.data()] = opentelemetry::nostd::get(value); + json_[name] = opentelemetry::nostd::get(value); return; case common::kTypeString: - json_[name][key.data()] = opentelemetry::nostd::get(value).data(); + json_[name] = opentelemetry::nostd::get(value).data(); return; default: return; @@ -321,7 +284,7 @@ void ElasticSearchRecordable::SetResource( { for (auto &attribute : resource.GetAttributes()) { - WriteKeyValue(attribute.first, attribute.second, "resource"); + WriteValue(attribute.second, attribute.first); } }