Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/instrumentation-memcached

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-memcached

OpenTelemetry instrumentation for `memcached` database client for memcached

  • 0.43.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
438K
decreased by-50.22%
Maintainers
3
Weekly downloads
 
Created

What is @opentelemetry/instrumentation-memcached?

@opentelemetry/instrumentation-memcached is an OpenTelemetry instrumentation library for Memcached. It allows you to automatically collect and report metrics and traces for Memcached operations, helping you monitor and debug your Memcached usage in a distributed system.

What are @opentelemetry/instrumentation-memcached's main functionalities?

Automatic Tracing

This feature allows you to automatically trace all Memcached operations. The code sample shows how to set up the NodeTracerProvider and register the Memcached instrumentation.

const { NodeTracerProvider } = require('@opentelemetry/node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { MemcachedInstrumentation } = require('@opentelemetry/instrumentation-memcached');

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

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

Custom Configuration

This feature allows you to customize the instrumentation by adding hooks for requests and responses. The code sample demonstrates how to set custom attributes on spans for Memcached commands and responses.

const { MemcachedInstrumentation } = require('@opentelemetry/instrumentation-memcached');

const memcachedInstrumentation = new MemcachedInstrumentation({
  requestHook: (span, requestInfo) => {
    span.setAttribute('memcached.command', requestInfo.command);
  },
  responseHook: (span, responseInfo) => {
    span.setAttribute('memcached.response', responseInfo.response);
  }
});

Other packages similar to @opentelemetry/instrumentation-memcached

Keywords

FAQs

Package last updated on 18 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc