apollo-server/packages/apollo-tracing
Jesse Rosenberger a3222ece11
Publish
- apollo-cache-control@0.5.0
 - apollo-datasource-rest@0.3.0
 - apollo-datasource@0.3.0
 - apollo-engine-reporting@1.0.0
 - apollo-graphql@0.1.0
 - apollo-server-azure-functions@2.4.0
 - apollo-server-cache-memcached@0.3.0
 - apollo-server-cache-redis@0.3.0
 - apollo-server-caching@0.3.0
 - apollo-server-cloud-functions@2.4.0
 - apollo-server-cloudflare@2.4.0
 - apollo-server-core@2.4.0
 - apollo-server-express@2.4.0
 - apollo-server-hapi@2.4.0
 - apollo-server-integration-testsuite@2.4.0
 - apollo-server-koa@2.4.0
 - apollo-server-lambda@2.4.0
 - apollo-server-micro@2.4.0
 - apollo-server-plugin-base@0.3.0
 - apollo-server-testing@2.4.0
 - apollo-server@2.4.0
 - apollo-tracing@0.5.0
 - graphql-extensions@0.5.0
2019-02-07 14:08:23 +02:00
..
src Remove some empty tests 2018-10-11 04:11:49 +02:00
.npmignore Rename apollo-cache-control-js and apollo-tracing-js and unify configs 2018-07-04 22:26:28 +02:00
package.json Publish 2019-02-07 14:08:23 +02:00
README.md Rename apollo-cache-control-js and apollo-tracing-js and unify configs 2018-07-04 22:26:28 +02:00
tsconfig.json Remove apollo-server-env as a project reference 2018-10-05 23:05:49 +02:00

Apollo Tracing (for Node.js)

This package is used to collect and expose trace data in the Apollo Tracing format.

It relies on instrumenting a GraphQL schema to collect resolver timings, and exposes trace data for an individual request under extensions as part of the GraphQL response.

This data can be consumed by Apollo Engine or any other tool to provide visualization and history of field-by-field execution performance.

Usage

Apollo Server

Apollo Server includes built-in support for tracing from version 1.1.0 onwards.

The only code change required is to add tracing: true to the options passed to the Apollo Server middleware function for your framework of choice. For example, for Express:

app.use('/graphql', bodyParser.json(), graphqlExpress({
  schema,
  context: {},
  tracing: true,
}));

If you are using express-graphql, we recommend you switch to Apollo Server. Both express-graphql and Apollo Server are based on the graphql-js reference implementation, and switching should only require changing a few lines of code.