Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

connect-datadog.js 396 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  1. const connectDatadog = require('connect-datadog')
  2. const statsd = require('../lib/statsd')
  3. module.exports = (req, res, next) => {
  4. const tags = []
  5. if ('nextjs' in req.query) {
  6. tags.push('nextjs')
  7. }
  8. return connectDatadog({
  9. dogstatsd: statsd,
  10. method: true, // Track HTTP methods (GET, POST, etc)
  11. response_code: true, // Track response codes
  12. tags
  13. })(req, res, next)
  14. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...