From 629fcf0b990b907c1d8ea400ee15e15b7998b4bf Mon Sep 17 00:00:00 2001 From: Roman Dzhabarov Date: Mon, 24 Oct 2016 21:16:13 -0700 Subject: [PATCH] Allow non intersecting spans matching in a trace. Additional data to span. --- source/common/tracing/http_tracer_impl.cc | 4 +++- test/common/tracing/http_tracer_impl_test.cc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/common/tracing/http_tracer_impl.cc b/source/common/tracing/http_tracer_impl.cc index af57fc34389d..d1590836ebc1 100644 --- a/source/common/tracing/http_tracer_impl.cc +++ b/source/common/tracing/http_tracer_impl.cc @@ -233,9 +233,11 @@ void LightStepSink::flushTrace(const Http::HeaderMap& request_headers, const Htt lightstep::Span span = tls_.getTyped(tls_slot_).tracer_.StartSpan( tracing_context.operationName(), {lightstep::StartTimestamp(request_info.startTime()), - lightstep::SetTag("join:x-request-id", request_headers.get(Http::Headers::get().RequestId)), + lightstep::SetTag("guid:x-request-id", request_headers.get(Http::Headers::get().RequestId)), lightstep::SetTag("request line", buildRequestLine(request_headers, request_info)), lightstep::SetTag("response code", buildResponseCode(request_info)), + lightstep::SetTag("request size", request_info.bytesReceived()), + lightstep::SetTag("response size", request_info.bytesSent()), lightstep::SetTag("host header", request_headers.get(Http::Headers::get().Host)), lightstep::SetTag( "downstream cluster", diff --git a/test/common/tracing/http_tracer_impl_test.cc b/test/common/tracing/http_tracer_impl_test.cc index 2fb025ad862b..e3049999a1be 100644 --- a/test/common/tracing/http_tracer_impl_test.cc +++ b/test/common/tracing/http_tracer_impl_test.cc @@ -470,6 +470,8 @@ TEST_F(LightStepSinkTest, FlushSpansTimer) { EXPECT_CALL(request_info, startTime()).WillOnce(Return(start_time)); Optional code(200); EXPECT_CALL(request_info, responseCode()).WillRepeatedly(ReturnRef(code)); + EXPECT_CALL(request_info, bytesReceived()).WillOnce(Return(10UL)); + EXPECT_CALL(request_info, bytesSent()).WillOnce(Return(100UL)); const std::string protocol = "http/1"; EXPECT_CALL(request_info, protocol()).WillOnce(ReturnRef(protocol));