npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

telemetry-events-aws-dynamodb

v2.1.2

Published

Telemetry events instrumentation for AWS SDK DynamoDB module

Readme

telemetry-events-aws-dynamodb

Stability: 1 - Experimental

NPM version

telemetry-events instrumentation for AWS SDK DynamoDB module.

Contributors

@tristanls

Contents

Installation

npm install telemetry-events-aws-dynamodb

Usage

To run the below example run:

npm run readme
"use strict";

const AWS = require("aws-sdk");
const events = require("events");
const LogTelemetryEvents = require("telemetry-events-log");
const pkg = require("../package.json");
const QuantifyTelemetryEvents = require("telemetry-events-quantify");
const TelemetryEvents = require("telemetry-events");

const instrument = require("../index.js");

const emitter = new events.EventEmitter();
const telemetryEmitter = new TelemetryEvents(
    {
        emitter: emitter,
        package: pkg
    }
);
const logs = new LogTelemetryEvents(
    {
        telemetry: telemetryEmitter
    }
);
const metrics = new QuantifyTelemetryEvents(
    {
        telemetry: telemetryEmitter
    }
);

let dynamodb = new AWS.DynamoDB(
{
    region: "us-east-1"
});

dynamodb = instrument(
    dynamodb,
    AWS.VERSION,
    [
        "getItem", "putItem", "deleteItem"
    ],
    {
        logs,
        metrics
    }
);

let documentClient = new AWS.DynamoDB.DocumentClient(
    {
        region: "us-east-1"
    }
);
documentClient = instrument.DocumentClient(
    documentClient,
    AWS.VERSION,
    [
        "createSet", "get"
    ],
    {
        logs,
        metrics
    }
);

console.log(typeof dynamodb.instrumentedGetItem);
// function
console.log(typeof dynamodb.instrumentedPutItem);
// function
console.log(typeof dynamodb.instrumentedDeleteItem);
// function

console.log(typeof documentClient.instrumentedCreateSet);
// function
console.log(typeof documentClient.instrumentedGet);
// function

Tests

npm test

Documentation

instrument(dynamodb, version, methods, telemetry)

  • dynamodb: Object Already created AWS.DynamoDB instance.
  • version: String AWS module version (use AWS's VERSION parameter).
  • methods: Array Array of methods to instrument.
  • telemetry: Object Telemetry helpers.
    • logs: Object telemetry-events-log instance.
    • metrics: Object telemetry-events-quantify instance.
  • Return: Object AWS.DynamoDB instance with additional instrumented methods.

For every specified method in methods creates an instrumented variant on the passed in dynamodb instance. For example, if methods = ["getItem"], the returned dynamodb object will have a dynamodb.instrumentedGetItem method.

instrument.DocumentClient(client, version, methods, telemetry)

  • client: Object Already created AWS.DynamoDB.DocumentClient instance.
  • version: String AWS module version (use AWS's VERSION parameter).
  • methods: Array Array of methods to instrument.
  • telemetry: Object Telemetry helpers.
    • logs: Object telemetry-events-log instance.
    • metrics: Object telemetry-events-quantify instance.
  • Return: Object AWS.DynamoDB.DocumentClient instance with additional instrumented methods.

For every specified method in methods creates an instrumented variant on the passed in client instance. For example, if methods = ["get"], the returned client object will have a client.instrumentedGet method.

instrumentedMethod(params, context, callback)

  • params: Object Parameters to call the instrumented method with.
  • context Object Call context.
    • metadata: Object (Default: undefined) Metadata to include in events.
    • parentSpan: Object (Default: undefined) telemetry-events-tracing parent span to create a child tracing span from.
    • paramsToLog: Object (Default: params) Parameters to log instead of params.
  • callback: Function function (error, data, context){} Callback that will be called with the results of the instrumented method.
    • error: Error Error from instrumented method result, if any.
    • data: Object Data form instrumented method result, if any.
    • context: Object Result context containing target (instrumented method) metadata.
      • targetMetadata: Object Target (instrumented method) metadata.

This is an example of an instrumented method signature (actual method names would be instrumentedGetItem, instrumentedPutItem, etc.).

Releases

We follow semantic versioning policy (see: semver.org):

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.