You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/06/15 20:49:48 UTC

[GitHub] [trafficcontrol] ARMmaster17 opened a new pull request #5941: Dsid log

ARMmaster17 opened a new pull request #5941:
URL: https://github.com/apache/trafficcontrol/pull/5941


   ## What does this PR (Pull Request) do?
   These changes add a `svc=...` tag to request logging for both DNS and HTTP requests. The value of this field is the `XmlId` of the delivery service that routed the request.
   
   - [x] This PR is not related to any Issue
   
   
   ## Which Traffic Control components are affected by this PR?
   
   - Traffic Router
   
   ## What is the best way to verify this PR?
   Pull code and build CiaB. Make a request against a DNS or HTTP delivery service and observe that the log output contains lines that contain one of the following:
   
   - `svc="mydeliveryservice1"`
   - `svc="-"`
   
   The second output should only be there if a request was made where no delivery service was used (e.g. an error occurred).
   
   ## The following criteria are ALL met by this PR
   
   - [x] This PR includes tests
   - [x] This PR includes documentation OR I have explained why documentation is unnecessary
   - [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [x] This PR includes any and all required license headers
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5941: Show delivery service ID in TR log output

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #5941:
URL: https://github.com/apache/trafficcontrol/pull/5941#discussion_r679303663



##########
File path: traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/http/RouterFilter.java
##########
@@ -112,11 +113,17 @@ private void writeHttpResponse(final HttpServletResponse response, final HttpSer
 
 			final Map<String,String> accessRequestHeaders = new HttpAccessRequestHeaders().makeMap(httpServletRequest, requestHeaders);
 
+			String deliveryServiceIds = "";
+			if (routeResult != null && routeResult.getDeliveryServices().size() > 0) {
+				deliveryServiceIds = routeResult.getDeliveryServicesLogString();
+			}
+
 			final HTTPAccessRecord access = httpAccessRecordBuilder.resultType(track.getResult())
 				.resultDetails(track.getResultDetails())
 				.resultLocation(track.getResultLocation())
 				.requestHeaders(accessRequestHeaders)
 				.regionalGeoResult(track.getRegionalGeoResult())
+					.deliveryServiceIds(deliveryServiceIds)

Review comment:
       nit: too much indentation here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ARMmaster17 commented on pull request #5941: Show delivery service ID in TR log output

Posted by GitBox <gi...@apache.org>.
ARMmaster17 commented on pull request #5941:
URL: https://github.com/apache/trafficcontrol/pull/5941#issuecomment-877199883


   I apologize for the delay. After some discussion it was determined that displaying all of the delivery services, delimited with a `|`, was the best way forward for our use case. This has been implemented in the latest commit and has been verified and tested locally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] smalenfant commented on pull request #5941: Show delivery service ID in TR log output

Posted by GitBox <gi...@apache.org>.
smalenfant commented on pull request #5941:
URL: https://github.com/apache/trafficcontrol/pull/5941#issuecomment-889056095


   I'm ok with merging this. Running in production on 5.1.2.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #5941: Show delivery service ID in TR log output

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #5941:
URL: https://github.com/apache/trafficcontrol/pull/5941#discussion_r652150957



##########
File path: traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/HTTPRouteResult.java
##########
@@ -60,6 +61,10 @@ public void setUrl(final URL url) {
 		return deliveryServices;
 	}
 
+	public String getDeliveryServicesLogString() {
+		return this.getDeliveryServices().stream().map(DeliveryService::getId).collect(Collectors.joining("|"));

Review comment:
       Is this due to `CLIENT_STEERING` delivery services? We want to log the target DS XML IDs joined with `|` instead of logging the XML ID of the `CLIENT_STEERING` DS?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp merged pull request #5941: Show delivery service ID in TR log output

Posted by GitBox <gi...@apache.org>.
rawlinp merged pull request #5941:
URL: https://github.com/apache/trafficcontrol/pull/5941


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org