From 1755a3cf4bb85897f6f0cc576d9ea9be516314a0 Mon Sep 17 00:00:00 2001 From: Quinn Milionis Date: Wed, 3 Dec 2025 13:28:18 -0800 Subject: [PATCH 1/2] use scout_transaction_id --- .gitignore | 1 + scout_apm_logging/handler.py | 2 +- tests/unit/test_handler.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a35bf7d..e0e31dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Python __pycache__/ +.venv/ .DS_Store # generated log files diff --git a/scout_apm_logging/handler.py b/scout_apm_logging/handler.py index 1e87b16..220de09 100644 --- a/scout_apm_logging/handler.py +++ b/scout_apm_logging/handler.py @@ -81,7 +81,7 @@ def emit(self, record): ) # Add Scout-specific attributes to the log record - record.scout_request_id = scout_request.request_id + record.scout_transaction_id = scout_request.request_id record.scout_start_time = scout_request.start_time.isoformat() # Add duration if the request is completed if scout_request.end_time: diff --git a/tests/unit/test_handler.py b/tests/unit/test_handler.py index 5dbd715..fc986b3 100644 --- a/tests/unit/test_handler.py +++ b/tests/unit/test_handler.py @@ -59,7 +59,7 @@ def test_emit_with_scout_request(mock_tracked_request, otel_scout_handler): otel_scout_handler.emit(record) mock_otel_handler.emit.assert_called_once() - assert record.scout_request_id == "test-id" + assert record.scout_transaction_id == "test-id" assert record.scout_start_time == "2024-03-06T12:00:00" assert record.scout_end_time == "2024-03-06T12:00:01" assert record.scout_tag_key == "value" @@ -94,7 +94,7 @@ def test_emit_when_scout_request_contains_operation( otel_scout_handler.emit(record) mock_otel_handler.emit.assert_called_once() - assert record.scout_request_id == "test-id" + assert record.scout_transaction_id == "test-id" assert record.scout_start_time == "2024-03-06T12:00:00" assert record.scout_end_time == "2024-03-06T12:00:01" assert record.scout_tag_key == "value" @@ -117,7 +117,7 @@ def test_emit_without_scout_request(mock_tracked_request, otel_scout_handler): otel_scout_handler.emit(record) mock_otel_handler.emit.assert_called_once() - assert not hasattr(record, "scout_request_id") + assert not hasattr(record, "scout_transaction_id") def test_emit_already_handling_log(otel_scout_handler): From 20753195f9583a6b77f8f060cdd955c3ed06ee47 Mon Sep 17 00:00:00 2001 From: Quinn Milionis Date: Wed, 3 Dec 2025 13:32:43 -0800 Subject: [PATCH 2/2] add changelog --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a5b8970 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Changelog + +## Pending +### Changed +- Rename `scout_request_id` log attribute to `scout_transaction_id` for compatability (#28) + +## [1.0.1] 2024-09-12 +### Added +- Django configuration compatibility (#24) +- Update package name in documentation (#22) + +## [1.0.0] 2024-09-10 +### Added +- Rename handler class to `ScoutLogHandler` for clarity (#19) + +## [0.1.2] 2024-09-05 +### Added +- Update readme with installation instructions (#17) +- Setting controller endpoint on log records (#15) +- Release workflow for automated publishing (#13) +- Attach controller endpoint to log entries (#11) +- Tests and GitHub Actions CI (#7) +- Scout Request Context integration (#5) +- Initial logging handler implementation (#3) +- OpenTelemetry logger integration (#1) +- Initial commit