elastic / elastic/apm-agent-nodejs

GraphQL transaction type and name not set on an Apollo Gateway service

Open
#3,245 13 comments 1 reaction 0 assignees View on GitHub
agent-nodejs community enhancement
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

**Describe the bug**

I have a graphql app setup using Apollo Gateway and apollo server express. The transactions get reported to APM but they get reported as normal http /graphql transaction and not as graphQL transaction type in the dropdown.
![Screenshot 2023-04-05 at 9 23 36 AM](https://user-images.githubusercontent.com/70232262/230098022-7557afdb-2f1f-4524-b79e-7a8727fb72e6.png)

**Environment (please complete the following information)**

- OS: Linux
- Node.js version: 16.19.1
- APM Server version: 7.17.4
- Agent version: 3.44.0

package.json

```
{
"name": "graph-gateway",
"version": "1.0.0",
"description": "",
"main": "dist/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Dejan",
"license": "ISC",
"dependencies": {
"elastic-apm-node": "^3.44.0",
"@apollo/gateway": "^2.4.1",
"apollo-server-express": "^3.12.0",
"express": "^4.18.2",
"lodash": "^4.17.21"
},
"devDependencies": {
"typescript": "^4.5.5"
}
}
```

index.ts
```
const apmHostName = process.env.APM_HOSTNAME;
const apmSecretToken = process.env.APM_SECRET_TOKEN;

const sampleRate = parseFloat(process.env.APM_SAMPLE_RATE as string);

const apm = require("elastic-apm-node");
apm.start({
serviceName : process.env.SERVICE_NAME,
serverUrl: apmHostName,
environment: process.env.APM_ENV,
logLevel: "debug",
transactionSampleRate: (sampleRate >= 0 && sampleRate <= 1) ? sampleRate : 1,
secretToken: apmSecretToken,
verifyServerCert: process.env.NODE_ENV !== "local",
cloudProvider: process.env.NODE_ENV === "local" ? "none" : "auto",
});

import { ApolloGateway, RemoteGraphQLDataSource } from "@apollo/gateway";
import { ApolloServer } from "apollo-server-express";
import fs from "fs";
import express from "express";
import _ from "lodash";

const servicePort: number = Number(process.env.PORT) || 3000;

async function startGateway() {
let gatewayConfig: any = {
buildService({ url }: any) {
return new RemoteGraphQLDataSource({
url,
willSendRequest({ request, context }: any) {
request.http.headers.set('company-name', context.companyName);
request.http.headers.set('roles', context.roles);
request.http.headers.set('client-id', context.clientId);
},
});
},
};

if (process.env.NODE_ENV === "local") {
gatewayConfig["supergraphSdl"] = fs.readFileSync('./supergraph.graphql').toString();
}

const gateway = new ApolloGateway(gatewayConfig);

const app = express();

const server = new ApolloServer({
gateway,
introspection: process.env.NODE_ENV === "local",
plugins: [
{
async requestDidStart(requestContext: any) {
apm.setCustomContext({
operationName: requestContext.request.operationName,
query: requestContext.request.query,
variables: requestContext.request.variables,
context: requestContext.context
});

return {
async didEncounterErrors(requestContext: any) {
requestContext.errors?.forEach((error: any) => {
apm.captureError(error, {
custom: {
subgraph: error?.extensions?.serviceName
}
});
});

apm.setTransactionOutcome("failure");
}
};
}
}
],
context: async ({ req }) => {
let rolesValue : string = _.get(req, 'headers.roles');

return {
companyName: req.headers["company-name"] ?? null,
clientId: req.headers["client-id"] ?? null,
roles: JSON.stringify( rolesValue ? rolesValue.split(',') : [] )
}
},
});

await server.start();

app.get("/api/v1/system/health", function(req, res) {
res.send("OK");
});

server.applyMiddleware({ app });

return app.listen({ port: servicePort });
}

async function startApolloServer() {
return startGateway();
}

startApolloServer().then((url: any) => {
console.log(
`Server started!`,
);
});
```

Debug Logs

```
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.363Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted request event call to http.Server.prototype.emit for /graphql"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.365Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start trace {\"trans\":\"09b9261f9cf1464d\",\"trace\":\"0ee40ff3ea28bbf8c5ea32f3d7610557\",\"name\":\"unnamed\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.366Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithTransRunContext()"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.370Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"setting transaction result {\"trans\":\"09b9261f9cf1464d\",\"trace\":\"0ee40ff3ea28bbf8c5ea32f3d7610557\",\"result\":\"HTTP 2xx\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.372Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"setting default transaction name: OPTIONS /graphql {\"trans\":\"09b9261f9cf1464d\",\"trace\":\"0ee40ff3ea28bbf8c5ea32f3d7610557\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.373Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext<> )","ecs":{"version":"1.6.0"},"message":"addEndedTransaction(OPTIONS /graphql)"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.379Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"transaction ignored by filter {\"trans\":\"09b9261f9cf1464d\",\"trace\":\"0ee40ff3ea28bbf8c5ea32f3d7610557\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.379Z","log":{"logger":"elastic-apm-node"},"trans":"09b9261f9cf1464d","name":"OPTIONS /graphql","trace":"0ee40ff3ea28bbf8c5ea32f3d7610557","type":"request","result":"HTTP 2xx","duration":8.789,"ecs":{"version":"1.6.0"},"message":"ended transaction"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.381Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted request event call to http.Server.prototype.emit for /graphql"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.381Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start trace {\"trans\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"unnamed\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.382Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithTransRunContext()"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.492Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"a1687e12f4170eab\",\"parent\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"unnamed\",\"type\":\"external\",\"subtype\":\"http\",\"action\":null}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.493Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted call to http.request {\"id\":\"d4c80769bd782f45\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.494Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"request details: {\"protocol\":\"http:\",\"host\":\"buyer-subgraph:3000\",\"id\":\"d4c80769bd782f45\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.499Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted request event call to http.Server.prototype.emit for /graphql"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.502Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"continue trace {\"trans\":\"6ea35beabe4c93a5\",\"parent\":\"a1687e12f4170eab\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"unnamed\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.503Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithTransRunContext()"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.566Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted call to graphql.execute"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.567Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"b50aae702985af3c\",\"parent\":\"6ea35beabe4c93a5\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"GraphQL: Unknown Query\",\"type\":\"db\",\"subtype\":\"graphql\",\"action\":\"execute\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.568Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"setting default transaction name: ExampleQuery__buyer_subgraph__0 zipCode (/graphql) {\"trans\":\"6ea35beabe4c93a5\",\"parent\":\"a1687e12f4170eab\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.570Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"933f194dbf23a8cf\",\"parent\":\"b50aae702985af3c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE Query.zipCode\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.571Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithSpanRunContext()"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.575Z","log":{"logger":"elastic-apm-node"},"method":"POST","path":"/local-location/_search","ecs":{"version":"1.6.0"},"message":"intercepted call to @elastic/elasticsearch.Transport.prototype.request"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.575Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"9b6b4000273ac106\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: POST /local-location/_search\",\"type\":\"db\",\"subtype\":\"elasticsearch\",\"action\":\"request\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.577Z","log":{"logger":"elastic-apm-node"},"method":"GET","path":"/","ecs":{"version":"1.6.0"},"message":"intercepted call to @elastic/elasticsearch.Transport.prototype.request"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.578Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"aa43c5192cec8002\",\"parent\":\"9b6b4000273ac106\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: GET /\",\"type\":\"db\",\"subtype\":\"elasticsearch\",\"action\":\"request\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.580Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted call to https.request {\"id\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.707Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"aa43c5192cec8002\",\"parent\":\"9b6b4000273ac106\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: GET /\",\"type\":\"db\",\"subtype\":\"elasticsearch\",\"action\":\"request\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.707Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(Elasticsearch: GET /)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.707Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"aa43c5192cec8002\",\"parent\":\"9b6b4000273ac106\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: GET /\",\"type\":\"db\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.709Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted call to https.request {\"id\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.713Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"aa43c5192cec8002\",\"parent\":\"9b6b4000273ac106\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: GET /\",\"type\":\"db\"}"}
buyer-subgraph-1 | {"log.level":"info","@timestamp":"2023-04-04T19:59:47.726Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"Sending error to Elastic APM: {\"id\":\"2f6988695546a89e091e46af20665940\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.830Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"9b6b4000273ac106\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: POST /local-location/_search\",\"type\":\"db\",\"subtype\":\"elasticsearch\",\"action\":\"request\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.830Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(Elasticsearch: POST /local-location/_search)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.831Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"9b6b4000273ac106\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: POST /local-location/_search\",\"type\":\"db\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.833Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"933f194dbf23a8cf\",\"parent\":\"b50aae702985af3c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE Query.zipCode\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.833Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(RESOLVE Query.zipCode)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.833Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"933f194dbf23a8cf\",\"parent\":\"b50aae702985af3c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE Query.zipCode\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.834Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"4e7d69dcddff8a6e\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.id\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.835Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithSpanRunContext()"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.835Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"64302de3e93621b8\",\"parent\":\"4e7d69dcddff8a6e\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.name\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.835Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithSpanRunContext()"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.836Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"fa2c05c40b30238c\",\"parent\":\"64302de3e93621b8\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.webName\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.837Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithSpanRunContext()"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.838Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"start span {\"span\":\"988df1ddbcb2aa67\",\"parent\":\"fa2c05c40b30238c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.stateCode\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.838Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"supersedeWithSpanRunContext()"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.839Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"4e7d69dcddff8a6e\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.id\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.839Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(RESOLVE ZipCode.id)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.839Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"4e7d69dcddff8a6e\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.id\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.839Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"64302de3e93621b8\",\"parent\":\"4e7d69dcddff8a6e\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.name\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.839Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(RESOLVE ZipCode.name)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"64302de3e93621b8\",\"parent\":\"4e7d69dcddff8a6e\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.name\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"fa2c05c40b30238c\",\"parent\":\"64302de3e93621b8\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.webName\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(RESOLVE ZipCode.webName)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"fa2c05c40b30238c\",\"parent\":\"64302de3e93621b8\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.webName\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"988df1ddbcb2aa67\",\"parent\":\"fa2c05c40b30238c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.stateCode\",\"type\":\"custom\",\"subtype\":null,\"action\":null}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(RESOLVE ZipCode.stateCode)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.840Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"988df1ddbcb2aa67\",\"parent\":\"fa2c05c40b30238c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.stateCode\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.841Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"b50aae702985af3c\",\"parent\":\"6ea35beabe4c93a5\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"GraphQL: ExampleQuery__buyer_subgraph__0 zipCode\",\"type\":\"db\",\"subtype\":\"graphql\",\"action\":\"execute\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.841Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(GraphQL: ExampleQuery__buyer_subgraph__0 zipCode)"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.841Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"b50aae702985af3c\",\"parent\":\"6ea35beabe4c93a5\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"GraphQL: ExampleQuery__buyer_subgraph__0 zipCode\",\"type\":\"db\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.844Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"setting transaction result {\"trans\":\"6ea35beabe4c93a5\",\"parent\":\"a1687e12f4170eab\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"result\":\"HTTP 2xx\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.845Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"9b6b4000273ac106\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"Elasticsearch: POST /local-location/_search\",\"type\":\"db\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.845Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"933f194dbf23a8cf\",\"parent\":\"b50aae702985af3c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE Query.zipCode\",\"type\":\"custom\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.845Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted http.ClientRequest response event {\"id\":\"d4c80769bd782f45\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.845Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"4e7d69dcddff8a6e\",\"parent\":\"933f194dbf23a8cf\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.id\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.845Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"64302de3e93621b8\",\"parent\":\"4e7d69dcddff8a6e\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.name\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.846Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"fa2c05c40b30238c\",\"parent\":\"64302de3e93621b8\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.webName\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.846Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"988df1ddbcb2aa67\",\"parent\":\"fa2c05c40b30238c\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"RESOLVE ZipCode.stateCode\",\"type\":\"custom\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.847Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"b50aae702985af3c\",\"parent\":\"6ea35beabe4c93a5\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"GraphQL: ExampleQuery__buyer_subgraph__0 zipCode\",\"type\":\"db\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.848Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"intercepted http.IncomingMessage end event {\"id\":\"d4c80769bd782f45\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.849Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"ended span {\"span\":\"a1687e12f4170eab\",\"parent\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"POST buyer-subgraph:3000\",\"type\":\"external\",\"subtype\":\"http\",\"action\":\"POST\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.850Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext<> )","ecs":{"version":"1.6.0"},"message":"addEndedTransaction(ExampleQuery__buyer_subgraph__0 zipCode (/graphql))"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.850Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext )","ecs":{"version":"1.6.0"},"message":"addEndedSpan(POST buyer-subgraph:3000)"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.851Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"encoding span {\"span\":\"a1687e12f4170eab\",\"parent\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"POST buyer-subgraph:3000\",\"type\":\"external\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.852Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending span {\"span\":\"a1687e12f4170eab\",\"parent\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"name\":\"POST buyer-subgraph:3000\",\"type\":\"external\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.852Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending transaction {\"trans\":\"6ea35beabe4c93a5\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\"}"}
buyer-subgraph-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.852Z","log":{"logger":"elastic-apm-node"},"trans":"6ea35beabe4c93a5","name":"ExampleQuery__buyer_subgraph__0 zipCode (/graphql)","parent":"a1687e12f4170eab","trace":"2cd752910a8e56288d67186f1cca8588","type":"graphql","result":"HTTP 2xx","duration":347.311,"ecs":{"version":"1.6.0"},"message":"ended transaction"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.859Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"setting transaction result {\"trans\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\",\"result\":\"HTTP 2xx\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.863Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"setting default transaction name: POST /graphql {\"trans\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.864Z","log":{"logger":"elastic-apm-node"},"ctxmgr":"AsyncLocalStorageRunContextManager( RunContext<> )","ecs":{"version":"1.6.0"},"message":"addEndedTransaction(POST /graphql)"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.866Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"sending transaction {\"trans\":\"d4c80769bd782f45\",\"trace\":\"2cd752910a8e56288d67186f1cca8588\"}"}
graph-gateway-1 | {"log.level":"debug","@timestamp":"2023-04-04T19:59:47.866Z","log":{"logger":"elastic-apm-node"},"trans":"d4c80769bd782f45","name":"POST /graphql","trace":"2cd752910a8e56288d67186f1cca8588","type":"request","result":"HTTP 2xx","duration":482.225,"ecs":{"version":"1.6.0"},"message":"ended transaction"}

```

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.