Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 5 additions & 6 deletions src/envoy/mixer/http_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const std::string kRequestSize = "request.size";
const std::string kRequestTime = "request.time";

const std::string kResponseHeaders = "response.headers";
const std::string kResponseHttpCode = "response.http.code";
const std::string kResponseLatency = "response.latency";
const std::string kResponseCode = "response.code";
const std::string kResponseDuration = "response.duration";
const std::string kResponseSize = "response.size";
const std::string kResponseTime = "response.time";

Expand Down Expand Up @@ -118,15 +118,14 @@ void FillRequestInfoAttributes(const AccessLog::RequestInfo& info,
attr->attributes[kResponseSize] = Attributes::Int64Value(info.bytesSent());
}

attr->attributes[kResponseLatency] = Attributes::DurationValue(
attr->attributes[kResponseDuration] = Attributes::DurationValue(
std::chrono::duration_cast<std::chrono::nanoseconds>(info.duration()));

if (info.responseCode().valid()) {
attr->attributes[kResponseHttpCode] =
attr->attributes[kResponseCode] =
Attributes::Int64Value(info.responseCode().value());
} else {
attr->attributes[kResponseHttpCode] =
Attributes::Int64Value(check_status_code);
attr->attributes[kResponseCode] = Attributes::Int64Value(check_status_code);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/envoy/mixer/integration_test/check_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const reportAttributesOkGet = `
"request.size": 0,
"response.time": "*",
"response.size": 0,
"response.latency": "*",
"response.http.code": 200,
"response.duration": "*",
"response.code": 200,
"response.headers": {
"date": "*",
"content-type": "text/plain; charset=utf-8",
Expand Down Expand Up @@ -115,8 +115,8 @@ const reportAttributesOkPost = `
"request.size": 12,
"response.time": "*",
"response.size": 12,
"response.latency": "*",
"response.http.code": 200,
"response.duration": "*",
"response.code": 200,
"response.headers": {
"date": "*",
"content-type": "text/plain",
Expand Down
8 changes: 4 additions & 4 deletions src/envoy/mixer/integration_test/failed_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const reportAttributesMixerFail = `
"request.size": 0,
"response.time": "*",
"response.size": 41,
"response.latency": "*",
"response.http.code": 401,
"response.duration": "*",
"response.code": 401,
"response.headers": {
"date": "*",
"content-type": "text/plain",
Expand Down Expand Up @@ -100,8 +100,8 @@ const reportAttributesBackendFail = `
"request.size": 0,
"response.time": "*",
"response.size": 25,
"response.latency": "*",
"response.http.code": 400,
"response.duration": "*",
"response.code": 400,
"response.headers": {
"date": "*",
"content-type": "text/plain; charset=utf-8",
Expand Down