Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 3 additions & 3 deletions sdk/include/opentelemetry/sdk/common/empty_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ namespace sdk
* with default attributes.
*/
static const opentelemetry::common::KeyValueIterableView<
std::array<std::pair<std::string, int>, 0>> &
std::array<std::pair<std::string, int32_t>, 0>> &
GetEmptyAttributes() noexcept
{
static const std::array<std::pair<std::string, int>, 0> array{};
static const std::array<std::pair<std::string, int32_t>, 0> array{};
static const opentelemetry::common::KeyValueIterableView<
std::array<std::pair<std::string, int>, 0>>
std::array<std::pair<std::string, int32_t>, 0>>
kEmptyAttributes(array);

return kEmptyAttributes;
Expand Down
7 changes: 2 additions & 5 deletions sdk/include/opentelemetry/sdk/trace/span_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,8 @@ class SpanData final : public Recordable
}

void AddEvent(nostd::string_view name,
opentelemetry::common::SystemTimestamp timestamp =
opentelemetry::common::SystemTimestamp(std::chrono::system_clock::now()),
const opentelemetry::common::KeyValueIterable &attributes =
opentelemetry::common::KeyValueIterableView<std::map<std::string, int>>(
{})) noexcept override
opentelemetry::common::SystemTimestamp timestamp,
const opentelemetry::common::KeyValueIterable &attributes) noexcept override
{
SpanDataEvent event(std::string(name), timestamp, attributes);
events_.push_back(event);
Expand Down
3 changes: 2 additions & 1 deletion sdk/test/trace/span_data_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ TEST(SpanData, Set)
data.SetStartTime(now);
data.SetDuration(std::chrono::nanoseconds(1000000));
data.SetAttribute("attr1", static_cast<int64_t>(314159));
data.AddEvent("event1", now);
data.AddEvent("event1", now,
opentelemetry::common::KeyValueIterableView<std::map<std::string, int32_t>>({}));

ASSERT_EQ(data.GetTraceId(), trace_id);
ASSERT_EQ(data.GetSpanId(), span_id);
Expand Down