Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update attributes to match the canonical attribute list. #232

Merged
merged 2 commits into from
Apr 7, 2017
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