zrhoffman commented on a change in pull request #4931:
URL: https://github.com/apache/trafficcontrol/pull/4931#discussion_r463826442



##########
File path: docs/source/development/debugging.rst
##########
@@ -298,6 +299,55 @@ Traffic Router
 
 * When you see that Tomcat is listening for debugger connections on port 5005, 
start debugging using the debug configuration that you created.
 
+Traffic Stats
+===============
+
+* Navigate to the ``infrastructure/cdn-in-a-box`` directory. Remove the 
existing RPMs because they contain release Go binaries do not include useful 
debugging information. Rebuild the RPMs with no optimization, for debugging:
+
+.. code-block:: shell
+       :caption: Remove release RPMs, then build debug RPMs
+
+       make very-clean
+       make debug
+
+.. tip:: If you have gone through the steps to :ref:`dev-building-natively`, 
you can run ``make debug native`` instead of ``make debug`` to build the RPMs 
quickly.
+
+* Still in ``infrastructure/cdn-in-a-box``, open ``variables.env`` and set 
``TS_DEBUG_ENABLE`` to ``true``.
+
+* Stop CDN-in-a-Box if it is running and remove any existing volumes. Rebuild 
the ``trafficstats`` image without reusing any cached layers to make sure it 
uses our fresh ``traffic_stats.rpm``. Then, start CDN-in-a-Box.
+
+.. code-block:: shell
+       :caption: docker-compose command for debugging Traffic Stats
+
+       alias mydc='docker-compose -f docker-compose.yml -f 
docker-compose.expose-ports.yml optional/docker-compose.debugging.yml'
+       mydc down -v
+       mydc build trafficstats-nondebug trafficstats
+       mydc up
+
+* Install `an IDE that supports delve 
<https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code>`_ 
and create a debugging configuration over port 2344. If you are using VS Code, 
the configuration should look like this:
+
+.. code-block:: json
+       :caption: VS Code launch.json for debugging Traffic Stats
+
+       {
+               "version": "0.2.0",
+               "configurations": [
+                       {
+                               "name": "Traffic Stats",
+                               "type": "go",
+                               "request": "attach",
+                               "mode": "remote",
+                               "port": 2344,

Review comment:
       Thanks, docs corrected in 69a21be4ac.




----------------------------------------------------------------
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:
[email protected]


Reply via email to