Skip to content

Commit 8a73dde

Browse files
authored
fix(axiom): externalCallCount should be added to the txn not just the error (#1006)
1 parent 34d720e commit 8a73dde

File tree

7 files changed

+101
-0
lines changed

7 files changed

+101
-0
lines changed

axiom/nr_txn.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,8 @@ nrobj_t* nr_txn_event_intrinsics(const nrtxn_t* txn) {
25822582
params, txn->unscoped_metrics, "WebFrontend/QueueTime", "queueDuration");
25832583
nr_txn_add_metric_total_as_attribute(params, txn->unscoped_metrics,
25842584
"External/all", "externalDuration");
2585+
nr_txn_add_metric_count_as_attribute(params, txn->unscoped_metrics,
2586+
"External/all", "externalCallCount");
25852587
nr_txn_add_metric_total_as_attribute(params, txn->unscoped_metrics,
25862588
"Datastore/all", "databaseDuration");
25872589
nr_txn_add_metric_count_as_attribute(params, txn->unscoped_metrics,

axiom/tests/test_cmd_txndata.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,7 @@ static void test_encode_txn_event(void) {
10941094
"\"duration\":0.98700,\"totalTime\":0.98700,\"nr.apdexPerfZone\":"
10951095
"\"F\","
10961096
"\"queueDuration\":3.00000,\"externalDuration\":2.00000,"
1097+
"\"externalCallCount\":1,"
10971098
"\"databaseDuration\":2.00000,"
10981099
"\"databaseCallCount\":2,"
10991100
"\"error\":false},"

axiom/tests/test_txn.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,6 +4056,7 @@ static void test_create_event(void) {
40564056
"\"nr.apdexPerfZone\":\"F\","
40574057
"\"queueDuration\":3.00000,"
40584058
"\"externalDuration\":2.00000,"
4059+
"\"externalCallCount\":1,"
40594060
"\"databaseDuration\":1.00000,"
40604061
"\"databaseCallCount\":1,"
40614062
"\"error\":false"
@@ -4078,6 +4079,7 @@ static void test_create_event(void) {
40784079
"\"totalTime\":0.98700,"
40794080
"\"queueDuration\":3.00000,"
40804081
"\"externalDuration\":2.00000,"
4082+
"\"externalCallCount\":1,"
40814083
"\"databaseDuration\":1.00000,"
40824084
"\"databaseCallCount\":1,"
40834085
"\"error\":false"
@@ -4103,6 +4105,7 @@ static void test_create_event(void) {
41034105
"\"nr.apdexPerfZone\":\"F\","
41044106
"\"queueDuration\":3.00000,"
41054107
"\"externalDuration\":2.00000,"
4108+
"\"externalCallCount\":1,"
41064109
"\"databaseDuration\":1.00000,"
41074110
"\"databaseCallCount\":1,"
41084111
"\"error\":false"
@@ -4126,6 +4129,7 @@ static void test_create_event(void) {
41264129
"\"nr.apdexPerfZone\":\"F\","
41274130
"\"queueDuration\":3.00000,"
41284131
"\"externalDuration\":2.00000,"
4132+
"\"externalCallCount\":1,"
41294133
"\"databaseDuration\":1.00000,"
41304134
"\"databaseCallCount\":1,"
41314135
"\"error\":false"
@@ -4148,6 +4152,7 @@ static void test_create_event(void) {
41484152
"\"nr.apdexPerfZone\":\"F\","
41494153
"\"queueDuration\":3.00000,"
41504154
"\"externalDuration\":2.00000,"
4155+
"\"externalCallCount\":1,"
41514156
"\"databaseDuration\":1.00000,"
41524157
"\"databaseCallCount\":1,"
41534158
"\"error\":false"

tests/integration/external/curl_exec/test_dt_simple.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,36 @@
2828
/*EXPECT_RESPONSE_HEADERS
2929
*/
3030

31+
/*EXPECT_ANALYTICS_EVENTS
32+
[
33+
"?? agent run id",
34+
{
35+
"reservoir_size": 50,
36+
"events_seen": 1
37+
},
38+
[
39+
[
40+
{
41+
"type": "Transaction",
42+
"name": "OtherTransaction\/php__FILE__",
43+
"timestamp": "??",
44+
"duration": "??",
45+
"totalTime": "??",
46+
"externalDuration": "??",
47+
"externalCallCount": 1,
48+
"guid": "??",
49+
"sampled": true,
50+
"priority": "??",
51+
"traceId": "??",
52+
"error": false
53+
},
54+
{},
55+
{}
56+
]
57+
]
58+
]
59+
*/
60+
3161
/*EXPECT_TRACED_ERRORS
3262
null
3363
*/

tests/integration/external/guzzle7/test_spans_are_created_correctly.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,35 @@
1919
newrelic.transaction_tracer.detail = 0
2020
*/
2121

22+
/*EXPECT_ANALYTICS_EVENTS
23+
[
24+
"?? agent run id",
25+
{
26+
"reservoir_size": 50,
27+
"events_seen": 1
28+
},
29+
[
30+
[
31+
{
32+
"type": "Transaction",
33+
"name": "OtherTransaction\/php__FILE__",
34+
"timestamp": "??",
35+
"duration": "??",
36+
"totalTime": "??",
37+
"externalDuration": "??",
38+
"externalCallCount": 1,
39+
"guid": "??",
40+
"sampled": true,
41+
"priority": "??",
42+
"traceId": "??",
43+
"error": false
44+
},
45+
{},
46+
{}
47+
]
48+
]
49+
]
50+
*/
2251

2352
/*EXPECT_SPAN_EVENTS_LIKE
2453
[

tests/integration/external/guzzle7/test_uncaught_bad_response_exception_sync.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,39 @@
8181
]
8282
*/
8383

84+
/*EXPECT_ANALYTICS_EVENTS
85+
[
86+
"?? agent run id",
87+
{
88+
"reservoir_size": 50,
89+
"events_seen": 1
90+
},
91+
[
92+
[
93+
{
94+
"type": "Transaction",
95+
"name": "OtherTransaction\/php__FILE__",
96+
"timestamp": "??",
97+
"duration": "??",
98+
"totalTime": "??",
99+
"externalDuration": "??",
100+
"externalCallCount": 1,
101+
"guid": "??",
102+
"sampled": true,
103+
"priority": "??",
104+
"traceId": "??",
105+
"error": true
106+
},
107+
{},
108+
{
109+
"errorType": "GuzzleHttp\\Exception\\BadResponseException",
110+
"errorMessage": "Uncaught exception 'GuzzleHttp\\Exception\\BadResponseException' with message 'ClientException' in __FILE__:??"
111+
}
112+
]
113+
]
114+
]
115+
*/
116+
84117
/*EXPECT_TRACED_ERRORS
85118
[
86119
"?? agent run id",

tests/integration/synthetics/test_happy_path_with_dt.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"nr.syntheticsJobId": "jjjjjjj-jjjj-1234-jjjj-jjjjjjjjjjjj",
6363
"nr.syntheticsMonitorId": "mmmmmmm-mmmm-1234-mmmm-mmmmmmmmmmmm",
6464
"externalDuration": "??",
65+
"externalCallCount": 1,
6566
"guid": "??",
6667
"sampled": true,
6768
"priority": "??",

0 commit comments

Comments
 (0)