You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/02/07 22:53:05 UTC

[GitHub] [trafficserver] traeak opened a new pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

traeak opened a new pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655


   This enhances the money_trace to allow it to run globally, with the ability to override the global with a remap plugin.
   
   Also adds in better logging support for the current transaction's trace header.
   
   New options:
   
   - --create-if-none=[true|false] (default: false)
   - --global-skip-header=[<name>] (prefer internal '@' header)
   - --header=[<name>] (default: X-MoneyTrace)
   - --pregen-header=[<name>] (prefer internal '@' header, use like %<{@pregen}cqh>


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] ezelkow1 commented on pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
ezelkow1 commented on pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#issuecomment-1045221899


   [approve ci rocky]


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] randall commented on a change in pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
randall commented on a change in pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#discussion_r818170183



##########
File path: tests/gold_tests/pluginTest/money_trace/money_trace.test.py
##########
@@ -0,0 +1,229 @@
+#  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.
+import os
+Test.Summary = '''
+Test money_trace remap
+'''
+
+# Test description:
+
+Test.SkipUnless(
+    #    Condition.PluginExists('xdebug.so'),

Review comment:
       remove commented out code?




-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] traeak merged pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
traeak merged pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655


   


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] traeak commented on pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
traeak commented on pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#issuecomment-1033976806


   [approve ci ubuntu]


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] bneradt commented on pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
bneradt commented on pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#issuecomment-1035876999


   [approve ci]


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] randall commented on a change in pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
randall commented on a change in pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#discussion_r818170403



##########
File path: tests/gold_tests/pluginTest/money_trace/money_trace.test.py
##########
@@ -0,0 +1,229 @@
+#  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.
+import os
+Test.Summary = '''
+Test money_trace remap
+'''
+
+# Test description:
+
+Test.SkipUnless(
+    #    Condition.PluginExists('xdebug.so'),
+    Condition.PluginExists('money_trace.so'),
+)
+Test.ContinueOnFail = False
+Test.testName = "money_trace remap"
+
+# Define ATS and configure
+ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False)
+
+# configure origin server
+server = Test.MakeOriginServer("server")
+
+req_chk = {"headers":
+           "GET / HTTP/1.1\r\n" + "Host: origin\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+res_chk = {"headers":
+           "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+server.addResponse("sessionlog.json", req_chk, res_chk)
+
+req_hdr = {"headers":
+           "GET /path HTTP/1.1\r\n" + "Host: www.example.com\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+res_hdr = {"headers":
+           "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+server.addResponse("sessionlog.json", req_hdr, res_hdr)
+
+ts.Disk.remap_config.AddLines([
+    f"map http://none/ http://127.0.0.1:{server.Variables.Port}",
+    f"map http://basic/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so",
+    f"map http://header/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--header=mt",
+    f"map http://pregen/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--pregen-header=@pregen",
+    f"map http://pgh/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--header=mt @pparam=--pregen-header=@pregen",
+    f"map http://create/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--create-if-none=true",
+    f"map http://cheader/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--create-if-none=true @pparam=--header=mt",
+    f"map http://cpregen/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--create-if-none=true @pparam=--pregen-header=@pregen",
+    f"map http://passthru/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--passthru=true",
+])
+
+# ts.Disk.plugin_config.AddLine("xdebug.so")

Review comment:
       remove commented out code?




-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] traeak commented on pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
traeak commented on pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#issuecomment-1033881878


   [approve ci]


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] traeak removed a comment on pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
traeak removed a comment on pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#issuecomment-1033881878


   [approve ci]


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] bneradt removed a comment on pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
bneradt removed a comment on pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#issuecomment-1035876999


   [approve ci]


-- 
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: github-unsubscribe@trafficserver.apache.org

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



[GitHub] [trafficserver] traeak commented on a change in pull request #8655: money_trace: allow custom header, change span-id gen, opt to create if none

Posted by GitBox <gi...@apache.org>.
traeak commented on a change in pull request #8655:
URL: https://github.com/apache/trafficserver/pull/8655#discussion_r821916778



##########
File path: tests/gold_tests/pluginTest/money_trace/money_trace.test.py
##########
@@ -0,0 +1,229 @@
+#  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.
+import os
+Test.Summary = '''
+Test money_trace remap
+'''
+
+# Test description:
+
+Test.SkipUnless(
+    #    Condition.PluginExists('xdebug.so'),

Review comment:
       removed

##########
File path: tests/gold_tests/pluginTest/money_trace/money_trace.test.py
##########
@@ -0,0 +1,229 @@
+#  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.
+import os
+Test.Summary = '''
+Test money_trace remap
+'''
+
+# Test description:
+
+Test.SkipUnless(
+    #    Condition.PluginExists('xdebug.so'),
+    Condition.PluginExists('money_trace.so'),
+)
+Test.ContinueOnFail = False
+Test.testName = "money_trace remap"
+
+# Define ATS and configure
+ts = Test.MakeATSProcess("ts", command="traffic_server", enable_cache=False)
+
+# configure origin server
+server = Test.MakeOriginServer("server")
+
+req_chk = {"headers":
+           "GET / HTTP/1.1\r\n" + "Host: origin\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+res_chk = {"headers":
+           "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+server.addResponse("sessionlog.json", req_chk, res_chk)
+
+req_hdr = {"headers":
+           "GET /path HTTP/1.1\r\n" + "Host: www.example.com\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+res_hdr = {"headers":
+           "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "\r\n",
+           "timestamp": "1469733493.993",
+           "body": ""
+           }
+server.addResponse("sessionlog.json", req_hdr, res_hdr)
+
+ts.Disk.remap_config.AddLines([
+    f"map http://none/ http://127.0.0.1:{server.Variables.Port}",
+    f"map http://basic/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so",
+    f"map http://header/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--header=mt",
+    f"map http://pregen/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--pregen-header=@pregen",
+    f"map http://pgh/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--header=mt @pparam=--pregen-header=@pregen",
+    f"map http://create/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--create-if-none=true",
+    f"map http://cheader/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--create-if-none=true @pparam=--header=mt",
+    f"map http://cpregen/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--create-if-none=true @pparam=--pregen-header=@pregen",
+    f"map http://passthru/ http://127.0.0.1:{server.Variables.Port} @plugin=money_trace.so @pparam=--passthru=true",
+])
+
+# ts.Disk.plugin_config.AddLine("xdebug.so")

Review comment:
       removed




-- 
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: github-unsubscribe@trafficserver.apache.org

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