Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .tav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
# See: https://github.com/watson/test-all-versions

'@apollo/server':
versions: ^4.0.0
peerDependencies: graphql@^16.6.0
node: '>=14.16.0'
commands: node test/instrumentation/modules/@apollo/server.test.js
- versions:
mode: latest-minors
include: '>=5.0.0 <6'
node: '>=20.0.0'
commands: node test/instrumentation/modules/@apollo/server.test.js
- versions:
mode: latest-minors
include: '>=4.0.0 <5'
peerDependencies: graphql@^16.6.0
node: '>=14.16.0'
commands: node test/instrumentation/modules/@apollo/server.test.js

generic-pool:
versions: ^2.0.0 || ^3.1.0
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/supported-technologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ By default transactions are named based on their matched HTTP route if the frame
| --- | --- | --- |
| [express-graphql](https://www.npmjs.com/package/express-graphql) | >=0.6.1 <0.13.0 | Will name all transactions by the GraphQL query name. There is a [known issue with node <10.4](https://github.com/elastic/apm-agent-nodejs/issues/2516). This module is deprecated and is no longer tested. |
| [apollo-server-express](https://www.npmjs.com/package/apollo-server-express) | >=2.0.4 <4 | Will name all transactions by the GraphQL query name. Versions before 2.9.6 are no longer tested. |
| [@apollo/server](https://www.npmjs.com/package/@apollo/server) | >=4.0.0 | Will name all transactions by the GraphQL query name |
| [@apollo/server](https://www.npmjs.com/package/@apollo/server) | >=4.0.0 <6 | Will name all transactions by the GraphQL query name |


## Tracing and Instrumentation [compatibility-tracing-and-instrumentation]
Expand Down
2 changes: 1 addition & 1 deletion lib/instrumentation/modules/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ module.exports = function (graphql, agent, { version, enabled }) {
if (trans._graphqlRoute) {
var name =
queries.length > 0 ? queries.join(', ') : 'Unknown GraphQL query';
if (trans.req) var path = getPathFromRequest(trans.req, true);
if (trans.req) var path = getPathFromRequest(trans.req, true, true);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to reviewer: The 3rd param is to use the path as transaction name and makes the test pass but I?m not 100% sure about the implications of changing this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't either. The tests are only testing cases where the path is '/', so kinda hard to know if there are real implications.

usePathAsTransactionName is in general dangerous because it can lead to high cardinality transaction names. But I'm not sure if that is a real concern for GraphQL endpoints where I think the GraphQL calls are all hanging off of a single HTTP path.

var defaultName = name;
defaultName = path ? defaultName + ' (' + path + ')' : defaultName;
defaultName = operationName
Expand Down
Loading
Loading