How to use the newrelic.endTransaction 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 lifechurch / melos / feature-server.js View on Github external
const finish = nr.createTracer('finish', () => {
					const RootComponent = getRootComponent(feature)

					if (RootComponent === null) {
						nr.endTransaction()
						res.status(500).send({ error: 4, message: `No root component defined for this feature: ${feature}` })
					}

					getRenderProps(feature, params.url).then(nr.createTracer('getRenderProps', (renderProps) => {
						let html = null
						try {
							html = renderToString()
						} catch (ex) {
								// throw new Error(`Error: 3 - Could Not Render ${feature} view`, ex)
							Raven.captureException(ex)
							nr.endTransaction()
							res.status(500).send({ error: 3, message: `Could Not Render ${feature} view`, ex, stack: ex.stack })
						}

						const initialState = Object.assign({}, startingState, store.getState(), { hosts: { nodeHost: getNodeHost(req), railsHost: params.railsHost } })
github porchdotcom / up-to-code / src / index.js View on Github external
)).finally(() => (
            newrelic.endTransaction()
        ))
    ))()