Skip to content

Commit d215428

Browse files
committed
added transaction type to error events
closes #383
1 parent a443375 commit d215428

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
* Added support for collecting system and process metrics (#361)
77
* Added `transaction.sampled` to errors (#371)
8+
* Added `transaction.type` to errors (#391)
89
* Added parsing of `/proc/self/cgroup` to capture container meta data (#352)
910
* Added option to configure logging for Flask using a log level (#344)
1011

elasticapm/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def _build_msg_for_logging(
386386
event_data["trace_id"] = transaction.trace_parent.trace_id
387387
event_data["parent_id"] = transaction.id
388388
event_data["transaction_id"] = transaction.id
389-
event_data["transaction"] = {"sampled": transaction.is_sampled}
389+
event_data["transaction"] = {"sampled": transaction.is_sampled, "type": transaction.transaction_type}
390390

391391
return event_data
392392

tests/client/client_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ def test_transaction_data_is_attached_to_errors(elasticapm_client):
648648
assert "transaction_id" not in errors[0]
649649
assert errors[1]["transaction_id"] == transaction.id
650650
assert errors[1]["transaction"]["sampled"]
651+
assert errors[1]["transaction"]["type"] == "test"
651652
assert "transaction_id" not in errors[2]
652653

653654

0 commit comments

Comments
 (0)