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

@opentelemetry/instrumentation-memcached

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-memcached

OpenTelemetry memcached automatic instrumentation package.

  • 0.27.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
401K
decreased by-54.59%
Maintainers
4
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 24 Jan 2022

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