@@ -24,31 +24,25 @@ namespace Http {
24
24
namespace Mixer {
25
25
namespace {
26
26
27
- const std::string kProxyPeerID = " Istio/Proxy" ;
28
-
29
27
// Define lower case string for X-Forwarded-Host.
30
28
const LowerCaseString kHeaderNameXFH (" x-forwarded-host" , false );
31
29
32
- const std::string kRequestHeaderPrefix = " requestHeader:" ;
33
- const std::string kRequestParamPrefix = " requestParameter:" ;
34
- const std::string kResponseHeaderPrefix = " responseHeader:" ;
30
+ const std::string kRequestHeaderPrefix = " request.headers." ;
31
+ const std::string kResponseHeaderPrefix = " response.headers." ;
35
32
36
33
// Define attribute names
37
- const std::string kAttrNamePeerId = " peerId" ;
38
- const std::string kAttrNameURL = " url" ;
39
- const std::string kAttrNameHttpMethod = " httpMethod" ;
40
- const std::string kAttrNameRequestSize = " requestSize" ;
41
- const std::string kAttrNameResponseSize = " responseSize" ;
42
- const std::string kAttrNameLogMessage = " logMessage" ;
43
- const std::string kAttrNameResponseTime = " responseTime" ;
44
- const std::string kAttrNameOriginIp = " originIp" ;
45
- const std::string kAttrNameOriginHost = " originHost" ;
34
+ const std::string kAttrNameRequestPath = " request.path" ;
35
+ const std::string kAttrNameRequestSize = " request.size" ;
36
+ const std::string kAttrNameResponseSize = " response.size" ;
37
+ const std::string kAttrNameResponseTime = " response.time" ;
38
+ const std::string kAttrNameOriginIp = " origin.ip" ;
39
+ const std::string kAttrNameOriginHost = " origin.host" ;
46
40
47
41
const std::string kEnvNameSourceService = " SOURCE_SERVICE" ;
48
42
const std::string kEnvNameTargetService = " TARGET_SERVICE" ;
49
43
50
- const std::string kAttrNameSourceService = " sourceService " ;
51
- const std::string kAttrNameTargetService = " targetService " ;
44
+ const std::string kAttrNameSourceService = " source.service " ;
45
+ const std::string kAttrNameTargetService = " target.service " ;
52
46
53
47
Attributes::Value StringValue (const std::string& str) {
54
48
Attributes::Value v;
@@ -106,14 +100,8 @@ void FillRequestHeaderAttributes(const HeaderMap& header_map,
106
100
},
107
101
attr);
108
102
109
- // Pass in all Query parameters.
110
- auto path = header_map.Path ();
111
- if (path != nullptr ) {
112
- for (const auto & it : Utility::parseQueryString (path->value ().c_str ())) {
113
- attr->attributes [kRequestParamPrefix + it.first ] = StringValue (it.second );
114
- }
115
- }
116
-
103
+ SetStringAttribute (kAttrNameRequestPath , header_map.Path ()->value ().c_str (),
104
+ attr);
117
105
SetStringAttribute (kAttrNameOriginIp , GetFirstForwardedFor (header_map), attr);
118
106
SetStringAttribute (kAttrNameOriginHost , GetLastForwardedHost (header_map),
119
107
attr);
@@ -167,7 +155,6 @@ void HttpControl::FillCheckAttributes(const HeaderMap& header_map,
167
155
168
156
SetStringAttribute (kAttrNameSourceService , source_service_, attr);
169
157
SetStringAttribute (kAttrNameTargetService , target_service_, attr);
170
- attr->attributes [kAttrNamePeerId ] = StringValue (kProxyPeerID );
171
158
}
172
159
173
160
void HttpControl::Check (HttpRequestDataPtr request_data, HeaderMap& headers,
0 commit comments