elastic / elastic/apm-agent-nodejs

transaction.result and transaction.outcome not set for http*s*

Open
#2,146 0 comments 0 reactions 0 assignees View on GitHub
8.8-candidate agent-nodejs bug good first issue
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

The agent has handling for setting `transaction.result` and `transaction.outcome` for *http* and *http2*, but not for the *https* instrumentation.

Here are small scripts for each of http, https, http2 that create a server and includes a comment showing the transaction that it current generates:

- http: https://gist.github.com/trentm/7e09fcb523e0996782ba0536e619492a
- https: https://gist.github.com/trentm/c32dd0091b129ebb119fa88fbf6f3c4a
- http2: https://gist.github.com/trentm/d90b746d3e7d03fe490287471b677be8

Here is the latter part of `diff -u playhttp.js playhttps.js` that shows the difference in the transaction produced (note that I've replaced variable values like the transaction id with vars like `"$id"`):

```diff
...
@@ -32,7 +37,7 @@
"transaction": {
"name": "GET unknown route",
"type": "request",
- "result": "HTTP 2xx",
+ "result": "success",
"id": "$id",
"trace_id": "$trace_id",
"subtype": null,
@@ -49,15 +54,15 @@
"method": "GET",
"url": {
"raw": "/",
- "protocol": "http:",
+ "protocol": "https:",
"hostname": "localhost",
"port": "$port",
"pathname": "/",
- "full": "http://localhost:$port/"
+ "full": "https://localhost:$port/"
},
"socket": {
"remote_address": "::1",
- "encrypted": false
+ "encrypted": true
},
"headers": {
"host": "localhost:$port",
@@ -79,7 +84,7 @@
"span_count": {
"started": 0
},
- "outcome": "success",
+ "outcome": "unknown",
"sample_rate": 1
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.