Skip to content

Commit

Permalink
Add apdexPerfZone attribute to Transaction. (#753)
Browse files Browse the repository at this point in the history
Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary-martinez@users.noreply.github.com>

Co-authored-by: Enriqueta De Leon <deleonenriqueta@users.noreply.github.com>
Co-authored-by: Kate Anderson <kanderson250@users.noreply.github.com>
Co-authored-by: Mary Martinez <mary-martinez@users.noreply.github.com>
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
  • Loading branch information
5 people committed Jan 27, 2023
1 parent 01ceca7 commit 1d8d078
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions newrelic/core/transaction_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ def transaction_event_intrinsics(self, stats_table):
def _add_if_not_empty(key, value):
if value:
intrinsics[key] = value

apdex_perf_zone = self.apdex_perf_zone()
_add_if_not_empty('apdexPerfZone', apdex_perf_zone)
_add_if_not_empty('nr.apdexPerfZone', apdex_perf_zone)

if self.errors:
intrinsics['error'] = True
Expand All @@ -467,8 +471,6 @@ def _add_if_not_empty(key, value):
','.join(self.alternate_path_hashes))
_add_if_not_empty('nr.referringTransactionGuid',
self.referring_transaction_guid)
_add_if_not_empty('nr.apdexPerfZone',
self.apdex_perf_zone())

if self.synthetics_resource_id:
intrinsics['nr.guid'] = self.guid
Expand Down
2 changes: 1 addition & 1 deletion tests/agent_features/test_attributes_in_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

AGENT_KEYS_ALL = TRACE_ERROR_AGENT_KEYS + REQ_PARAMS

TRANS_EVENT_INTRINSICS = ("name", "duration", "type", "timestamp", "totalTime", "error")
TRANS_EVENT_INTRINSICS = ("name", "duration", "type", "timestamp", "totalTime", "error", "nr.apdexPerfZone", "apdexPerfZone")
TRANS_EVENT_AGENT_KEYS = [
"response.status",
"request.method",
Expand Down

0 comments on commit 1d8d078

Please sign in to comment.