* Remove json.parse(json.stringify( usage to improve performance * Fix missing / duplicate keys in some renders * Fix missing react-is dependency (only seemed to cause problems from pruning on the heroku deploy) * Add nextjs tag to datadog-connect config when nextjs is a query param * Fix router.asPath usage to exclude query param * Fix styling inconsistencies noticed when testing * Add a few tests
18 lines
396 B
JavaScript
18 lines
396 B
JavaScript
const connectDatadog = require('connect-datadog')
|
|
const statsd = require('../lib/statsd')
|
|
|
|
module.exports = (req, res, next) => {
|
|
const tags = []
|
|
|
|
if ('nextjs' in req.query) {
|
|
tags.push('nextjs')
|
|
}
|
|
|
|
return connectDatadog({
|
|
dogstatsd: statsd,
|
|
method: true, // Track HTTP methods (GET, POST, etc)
|
|
response_code: true, // Track response codes
|
|
tags
|
|
})(req, res, next)
|
|
}
|