Skip to content

Commit

Permalink
Rename response.http.code (envoyproxy#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwzhang authored Feb 24, 2017
1 parent 20e19d2 commit 7fe10df
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/envoy/mixer/http_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const std::string kAttrNameResponseSize = "response.size";
const std::string kAttrNameResponseTime = "response.time";
const std::string kAttrNameOriginIp = "origin.ip";
const std::string kAttrNameOriginHost = "origin.host";
const std::string kResponseStatusCode = "response.status.code";
const std::string kResponseHttpCode = "response.http.code";

Attributes::Value StringValue(const std::string& str) {
Attributes::Value v;
Expand Down Expand Up @@ -133,11 +133,10 @@ void FillRequestInfoAttributes(const AccessLog::RequestInfo& info,
Int64Value(info.duration().count());
}
if (info.responseCode().valid()) {
attr->attributes[kResponseStatusCode] =
StringValue(std::to_string(info.responseCode().value()));
attr->attributes[kResponseHttpCode] =
Int64Value(info.responseCode().value());
} else {
attr->attributes[kResponseStatusCode] =
StringValue(std::to_string(check_status_code));
attr->attributes[kResponseHttpCode] = Int64Value(check_status_code);
}
}

Expand Down

0 comments on commit 7fe10df

Please sign in to comment.