ignore (SPA API)

Syntax

newrelic.interaction().ignore()

Overrides other SPA save() calls; ignores an interaction so it is not saved or sent to New Relic.

Requirements

  • Browser Pro+SPA agent (v963 or higher)

  • If you're using npm to install the browser agent, you must enable the spa feature when instantiating the BrowserAgent class. In the features array, add the following:

    import { Spa } from '@newrelic/browser-agent/features/spa';
    const options = {
    info: { ... },
    loader_config: { ... },
    init: { ... },
    features: [
    Spa
    ]
    }

    For more information, see the npm browser installation documentation.

Description

This SPA method will cause an interaction to be ignored. It will not be saved or sent to New Relic. This method overrides any previous or subsequent calls to save().

Return values

This method returns the same API object created by interaction().

Examples

router.addRoute('/uninteresting-route', () => {
newrelic.interaction() // Get handle to current interaction.
.ignore(); // Ignore this interaction to ensure it will not be saved.
renderUninterestingRoute(); // Render route.
});