8000 Apply suggestions from code review · open-telemetry/opentelemetry-cpp@9db948d · GitHub
[go: up one dir, main page]

Skip to content

Commit 9db948d

Browse files
authored
Apply suggestions from code review
1 parent d160f8a commit 9db948d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sdk/include/opentelemetry/sdk/trace/span_data.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ class SpanData final : public Recordable
254254
}
255255

256256
void AddEvent(nostd::string_view name,
257-
opentelemetry::common::SystemTimestamp timestamp,
258-
const opentelemetry::common::KeyValueIterable &attributes) noexcept override
257+
opentelemetry::common::SystemTimestamp timestamp =
258+
opentelemetry::common::SystemTimestamp(std::chrono::system_clock::now()),
259+
const opentelemetry::common::KeyValueIterable &attributes =
260+
opentelemetry::common::KeyValueIterableView<std::map<std::string, int32_t>>) noexcept override
259261
{
260262
SpanDataEvent event(std::string(name), timestamp, attributes);
261263
events_.push_back(event);

sdk/test/trace/span_data_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ TEST(SpanData, Set)
6969
data.SetStartTime(now);
7070
data.SetDuration(std::chrono::nanoseconds(1000000));
7171
data.SetAttribute("attr1", static_cast<int64_t>(314159));
72-
data.AddEvent("event1", now,
73-
opentelemetry::common::KeyValueIterableView<std::map<std::string, int32_t>>({}));
72+
data.AddEvent("event1", now);
7473

7574
ASSERT_EQ(data.GetTraceId(), trace_id);
7675
ASSERT_EQ(data.GetSpanId(), span_id);

0 commit comments

Comments
 (0)
0