Repository: scoutapp/scout_apm_python (python)

Issue:
Lower span limit to a debug level message
Currently we log these as a warn message, and can be quite loud for logging

https://github.com/scoutapp/scout_apm_python/blob/master/src/scout_apm/core/tracked_request.py#L92-L96

Pull request description:
Change max spans reached log level to debug.
Closes #653

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6eb1893..9603c25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,14 +1,16 @@
 # Changelog
 
 ## Pending
-- Improved debug logging for requests. It now includes some summary
-  information about the request.
-  ([Issue #654](https://github.com/scoutapp/scout_apm_python/issues/654))
-- Added Celery's ``priority`` delivery info to the set of tags.
 - Removed parsing queue time from Amazon ALB header, X-Amzn-Trace-Id.
   The time portion of the header only has the truncated seconds which
   appears as about 500ms for queue time constantly.
   ([Issue #631](https://github.com/scoutapp/scout_apm_python/issues/631))
+- Added Celery's ``priority`` delivery info to the set of tags.
+- Changed max spans reached log level from warning to debug.
+  ([Issue #653](https://github.com/scoutapp/scout_apm_python/issues/653))
+- Improved debug logging for requests. It now includes some summary
+  information about the request.
+  ([Issue #654](https://github.com/scoutapp/scout_apm_python/issues/654))
 
 ## [2.19.0] 2021-05-04
 
diff --git a/src/scout_apm/core/tracked_request.py b/src/scout_apm/core/tracked_request.py
index 4fe3a00..55ed674 100644
--- a/src/scout_apm/core/tracked_request.py
+++ b/src/scout_apm/core/tracked_request.py
@@ -91,7 +91,7 @@ class TrackedRequest(object):
 
         if len(self.complete_spans) >= self.MAX_COMPLETE_SPANS:
             if not self.hit_max:
-                logger.warning(
+                logger.debug(
                     "Hit the maximum number of spans, this trace will be incomplete."
                 )
                 self.hit_max = True


Test patch:
diff --git a/tests/unit/core/test_tracked_request.py b/tests/unit/core/test_tracked_request.py
index c3848a2..31d8f12 100644
--- a/tests/unit/core/test_tracked_request.py
+++ b/tests/unit/core/test_tracked_request.py
@@ -133,7 +133,7 @@ def test_start_span_at_max_ignores_span(caplog, tracked_request):
     assert caplog.record_tuples == [
         (
             "scout_apm.core.tracked_request",
-            logging.WARNING,
+            logging.DEBUG,
             "Hit the maximum number of spans, this trace will be incomplete.",
         )
     ]