How to use the datadog-metrics.gauge function in datadog-metrics

To help you get started, we’ve selected a few datadog-metrics 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 Nordstrom / serverless-lighthouse-template / handler.js View on Github external
lighthouse(event.target, flags).then(function(results) {
    // Increment the lighthouse counter
    metrics.increment('lighthouse.invoke')

    // Get total page load time metric
    // push metric to datadog, ref: https://github.com/dbader/node-datadog-metrics#gauges
    metrics.gauge("total", results.timing.total)

    // Get the Lighthouse score for the website
    // ref: https://developers.google.com/web/tools/lighthouse/scoring
    metrics.gauge("score", results.score)

    // Parse report blob to extract performance metrics
    results.reportCategories.filter(function(v){
      return v["id"] == "performance"
    })[0].audits.filter(function(v){
      return v["group"] == "perf-metric"
    }).forEach(function(chunk){

      // Push each metric to datadog
      metrics.gauge(chunk.id, chunk.result.rawValue)

    })
github Nordstrom / serverless-lighthouse-template / handler.js View on Github external
lighthouse(event.target, flags).then(function(results) {
    // Increment the lighthouse counter
    metrics.increment('lighthouse.invoke')

    // Get total page load time metric
    // push metric to datadog, ref: https://github.com/dbader/node-datadog-metrics#gauges
    metrics.gauge("total", results.timing.total)

    // Get the Lighthouse score for the website
    // ref: https://developers.google.com/web/tools/lighthouse/scoring
    metrics.gauge("score", results.score)

    // Parse report blob to extract performance metrics
    results.reportCategories.filter(function(v){
      return v["id"] == "performance"
    })[0].audits.filter(function(v){
      return v["group"] == "perf-metric"
    }).forEach(function(chunk){

      // Push each metric to datadog
      metrics.gauge(chunk.id, chunk.result.rawValue)

    })
    return results
  })
  .then(() => {
github Nordstrom / serverless-lighthouse-template / handler.js View on Github external
}).forEach(function(chunk){

      // Push each metric to datadog
      metrics.gauge(chunk.id, chunk.result.rawValue)

    })
    return results
github getndazn / dazn-lambda-powertools / packages / lambda-powertools-datadog-metrics / datadog-metrics-sync.js View on Github external
const gauge = (key, value, tags, timestamp=Date.now()) => {
  metrics.gauge(key, value, tags || [], timestamp)
}

datadog-metrics

Buffered metrics reporting via the Datadog HTTP API

MIT
Latest version published 7 months ago

Package Health Score

79 / 100
Full package analysis