How to use the newrelic.setTransactionName function in newrelic

To help you get started, we’ve selected a few newrelic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trainline / environment-manager / server / modules / express-middleware / swaggerNewRelicMiddleware.js View on Github external
function newRelicSwaggerMiddleware(req, res, next) {
  let newrelic = require('newrelic'); // eslint-disable-line global-require
  newrelic.setTransactionName(path.join(API_BASE_PATH, req.path));
  next();
}
github lifechurch / melos / feature-server.js View on Github external
router.post('/featureImport/*', urlencodedParser, (req, res) => {
	const { feature, params, auth } = req.body
	const assetPrefix = getAssetPrefix(req)
	const Locale = getLocale(params.languageTag)

	nr.setTransactionName(`featureImport/${feature}`)

	Raven.setContext({ user: auth, tags: { feature, url: params.url }, extra: { params } })

	reactCookie.plugToRequest(req, res)

	let verifiedAuth = null
	checkAuth(auth).then(nr.createTracer('checkingAuth', (authResult) => {
		const sessionData = Object.assign({}, authResult.userData)
		authResult.userData.password = null
		verifiedAuth = authResult
		const defaultState = getDefaultState(feature)
		let startingState = Object.assign({}, defaultState, { auth: verifiedAuth })
		startingState = mapStateToParams(feature, startingState, params)

		try {
			const history = createMemoryHistory()