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 2020/05/29 21:15:31 UTC

[GitHub] [trafficcontrol] mitchell852 opened a new pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

mitchell852 opened a new pull request #4742:
URL: https://github.com/apache/trafficcontrol/pull/4742


   ## What does this PR (Pull Request) do?
   Fixes a regression where metric types were being limited to a predefined set.
   
   - [x] This PR fixes #4740 
   
   ## Which Traffic Control components are affected by this PR?
   
   - Traffic Ops
   
   ## What is the best way to verify this PR?
   Run the API tests.
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   master
   4.0.0
   4.1.0 RC1
   
   ## The following criteria are ALL met by this PR
   
   - [x] This PR includes tests OR I have explained why tests are unnecessary
   - [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 ensures that database migration sequence is correct OR this PR does not include a database migration
   - [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] dneuman64 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   I understand the need for this and why Jeremy is fixing it.  We should allow some sort of latitude in the API to allow for some customization, but maybe not just strings.  What if we changed the code so the requesting user had to pass in a metric that pattern matched whatever we define?  So instead of ONLY allowing `kbps` we allow `kbps*` so that if we wanted to create a metric called `kbps_custom` it would still work?  I think that would satisfy our need to not have such a strict API while also keeping some safety.


----------------------------------------------------------------
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] ocket8888 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   I agree, whitelisting does sound safer/easier


----------------------------------------------------------------
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] dneuman64 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   The downside with a whitelist is having to restart the application for it to take effect.  It would be nice if we could do a reload or have the list loaded dynamically.


----------------------------------------------------------------
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] dneuman64 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   That could work though we still have to handle the data coming back which is why I suggested a wildcard.  In other words, if I choose to use `kbps_test` instead of just `kbps` then the data format still has to match.  I guess we could keep those guidelines with a whitelist.  


----------------------------------------------------------------
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] ocket8888 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   This introduces a vulnerability that allows read-only users to destroy stats data. I don't recommend we include it, at least not this way.


----------------------------------------------------------------
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] mitchell852 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   this PR now has a "whitelist" although named "supported_ds_metrics" instead. I'll leave all the SIGHUPness for another PR.


----------------------------------------------------------------
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] mattjackson220 merged pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   


----------------------------------------------------------------
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] rob05c commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   Yes, only profiling currently: https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/traffic_ops_golang.go#L225
   
   It shouldn't be too difficult to swap atomic pointers for the HTTP Handler, to reload everything. TO could probably copy-and-paste Grove's code for that:
   
   https://github.com/apache/trafficcontrol/blob/master/grove/cache/handler.go#L47
   https://github.com/apache/trafficcontrol/blob/master/grove/grove.go#L296


----------------------------------------------------------------
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] mitchell852 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   I think a whitelist probably makes sense. I can add support for that.


----------------------------------------------------------------
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] mitchell852 edited a comment on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on pull request #4742:
URL: https://github.com/apache/trafficcontrol/pull/4742#issuecomment-636906713


   I think a whitelist probably makes sense. I can add support for that as data loss is not something anyone wants. :)


----------------------------------------------------------------
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] ocket8888 commented on pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   Does TO not support SIGHUP reloads? I feel like I should know that.


----------------------------------------------------------------
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 pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   Tossing another idea out there, could we add a new config option that's just a whitelist of strings of acceptable metric types? That way adding a new metric type is just a reconfiguration, and it doesn't seem like we add new metric types often enough to where the reconfig+restart would be too much to ask.


----------------------------------------------------------------
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 pull request #4742: removes restriction on metric types from /api/deliveryservice_stats

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


   AFAIK only the profiling config is SIGHUP-able. Making other TO config SIGHUP-able likely requires a bit more work, but it's something we should probably do (outside the scope of this issue).


----------------------------------------------------------------
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