You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

appdynamics-nodejs-extras

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appdynamics-nodejs-extras

Additional functionality for the AppDynamics Node.JS agent

1.4.1
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

AppDynamics Node.JS Extras

This package includes additional functionality for the AppDynamics Node.JS agent.

BTs for GraphQL

Use the appdynamics4graphql middleware with apollo-server-express to have an out of the box detection of business transactions for your GraphQL application:

const appdynamics = require("appdynamics");
const { appdynamics4graphql } = require('appdynamics-nodejs-extras')
...
// Set options for appdynamics4graphql
const options = { ... }
const app = express()
app.use(json(), appdynamics4graphql(appdynamics, {debug: true}))
const server = new ApolloServer({
  ...
})
server.applyMiddleware({ app })
app.listen({ port: 4000 }, () => console.log(`app running`));

With this your operation names will be reported as business transactions. If you don't provide an operation name the context wrapper will use the operation type as identifier (query, mutation or subscription) and call the BTs unnamedQuery, unnamedMutation and unnamedSubscription. If an error occurs or no name can be extracted, the default BT name is IntrospectionQuery.

You can reconfigure this default behaviour by setting the following options:

  • inferWithField (default: false): If set to true and if no operation name is provided, this will add the "root name" of your operation to the BT name. So instead of unnamedQuery you will get a BT named query fieldname.
  • defaultBt (default: "IntrospectionQuery"): Change the name of the default BT.
  • debug (default: false): If set to true, there will be messages logged to console. As alternative you can provide a function that will be used to log those messages.
  • addSnapshotData (default: true): If set to true, add operationName and operationType to snapshot data.
  • addAnalyticsData (default: true): If set to true, add opartionName and operationType to analytics data.
  • logQuery (default: false): If set to true, the received GraphQL query will be logged into snapshot data (no analytics!).
  • logRequestHeaders: (default: []): Provide a list of response headers that should be collected into snapshot data/analytics data.
  • logResponseHeaders: (default: []): Provide a list of response headers that should be collected into snapshot data/analytics data.
  • withCCID (default: true): Create a custom correlation ID, send it to analytics/snapshot data and create a custom header called appdynamics-graphql-ccid, that is collectable on the frontend site.
  • withResponseHook (default: false): If set to true, error information is collected from the query response. If you provide a callback function you can access the response, the response body, a method to collect data and the transaction object:
    options.withResponseHook = (response, body, collectData, transaction) => {
      collectData('errorId', body.errors[0].id)
    }
    

FAQs

Package last updated on 05 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts