How to use aws-embedded-metrics - 6 common examples

To help you get started, we’ve selected a few aws-embedded-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 fourTheorem / slic-starter / checklist-service / services / checklists / entries / entries.js View on Github external
'#title': 'title',
      '#value': 'value'
    },
    ExpressionAttributeValues: {
      ':title': title,
      ':value': value
    },
    ReturnValues: 'NONE'
  }

  await dynamoDocClient()
    .update(params)
    .promise()

  const metrics = createMetricsLogger()
  metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
  await metrics.flush()

  return {
    entId,
    title,
    value
  }
}
github fourTheorem / slic-starter / checklist-service / services / checklists / entries / entries.js View on Github external
title,
        value
      }
    },

    ReturnValues: 'ALL_NEW'
  }
  const {
    Attributes: { entries }
  } = await dynamoDocClient()
    .update(params)
    .promise()

  const metrics = createMetricsLogger()
  metrics.putMetric('NumEntries', Object.keys(entries).length, Unit.Count)
  metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
  await metrics.flush()

  return {
    entId,
    title,
    value
  }
}
github fourTheorem / slic-starter / checklist-service / services / checklists / entries / entries.js View on Github external
'#entId': entId,
      '#title': 'title',
      '#value': 'value'
    },
    ExpressionAttributeValues: {
      ':title': title,
      ':value': value
    },
    ReturnValues: 'NONE'
  }

  await dynamoDocClient()
    .update(params)
    .promise()

  const metrics = createMetricsLogger()
  metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
  await metrics.flush()

  return {
    entId,
    title,
    value
  }
}
github fourTheorem / slic-starter / checklist-service / services / checklists / entries / entries.js View on Github external
ExpressionAttributeValues: {
      ':entry': {
        title,
        value
      }
    },

    ReturnValues: 'ALL_NEW'
  }
  const {
    Attributes: { entries }
  } = await dynamoDocClient()
    .update(params)
    .promise()

  const metrics = createMetricsLogger()
  metrics.putMetric('NumEntries', Object.keys(entries).length, Unit.Count)
  metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
  await metrics.flush()

  return {
    entId,
    title,
    value
  }
}
github awslabs / aws-embedded-metrics-node / examples / agent / index.js View on Github external
const doWork = metricScope(metrics => async event => {
  metrics.putDimensions({ Operation: 'Agent' });
  metrics.putMetric('ExampleMetric', 100, Unit.Milliseconds);
  metrics.setProperty('RequestId', '422b1569-16f6-4a03-b8f0-fe3fd9b100f8');
});
github awslabs / aws-embedded-metrics-node / examples / agent / index.js View on Github external
const { metricScope, Unit } = require('aws-embedded-metrics');

const doWork = metricScope(metrics => async event => {
  metrics.putDimensions({ Operation: 'Agent' });
  metrics.putMetric('ExampleMetric', 100, Unit.Milliseconds);
  metrics.setProperty('RequestId', '422b1569-16f6-4a03-b8f0-fe3fd9b100f8');
});

doWork();

aws-embedded-metrics

AWS Embedded Metrics Client Library

Apache-2.0
Latest version published 2 months ago

Package Health Score

87 / 100
Full package analysis

Similar packages