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

@platformatic/memcached-otel

v0.1.2

Published

OpenTelemetry tracing instrumentation for @platformatic/memcached, built on its diagnostics channels

Readme

@platformatic/memcached-otel

OpenTelemetry tracing for @platformatic/memcached.

The client publishes one set of node:diagnostics_channel tracing events per logical command on the platformatic.memcached.command channel. This package subscribes to those events and turns each command into a single CLIENT span following the OpenTelemetry database semantic conventions: no module patching, no monkey-patching — it works however the client is loaded (ESM, CJS, bundled) and adds zero overhead to commands when disabled.

Installation

npm install @platformatic/memcached-otel @opentelemetry/api

@opentelemetry/api and @platformatic/memcached are peer dependencies.

Usage

MemcachedInstrumentation is a standard Instrumentation subclass, so it plugs into the usual SDK setup:

import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { MemcachedInstrumentation } from '@platformatic/memcached-otel'

const provider = new NodeTracerProvider()
provider.register()

registerInstrumentations({
  instrumentations: [new MemcachedInstrumentation()]
})

Or standalone, without the registry:

const instrumentation = new MemcachedInstrumentation()
instrumentation.setTracerProvider(provider) // omit to use the global provider

// later
instrumentation.disable()

It also composes with @opentelemetry/auto-instrumentations-node: add it to the instrumentations array next to the bundled ones.

Because subscription happens through diagnostics channels, the instrumentation traces every Client in the process, including clients created before it was enabled. disable() unsubscribes and stops span creation immediately; when nothing is subscribed the client skips all diagnostics payload allocation.

Spans

One span per logical command, regardless of how auto-pipelining batches socket writes:

  • Name: the wire verb (mg, ms, md, ma, mn or version).
  • Kind: CLIENT.
  • Attributes: db.system = memcached, db.operation.name = the verb, server.address and server.port.
  • Key: when the client is created with diagnosticsIncludeKeys: true, the key is added as db.memcached.key. Keys may carry sensitive data, so this is off by default — see the client's diagnostics docs.
  • Status: errors (connection, protocol or server errors) set span status ERROR and record the exception. Misses and conditional stores/deletes that did not apply are not errors: the span ends with status unset, like a hit.

The span starts when the command is issued (queueing and reconnection wait time are part of the span) and ends exactly once when the command settles.

memcached has no header mechanism, so no trace context is propagated to the server: these are leaf spans by nature. They parent to whatever span is active in the current context when the command is issued.

License

Apache-2.0 — see LICENSE.