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

opentelemetry-instrumentation-elasticsearch

Package Overview
Dependencies
Maintainers
2
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentelemetry-instrumentation-elasticsearch

open telemetry instrumentation for the `elasticsearch` module

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
decreased by-8.28%
Maintainers
2
Weekly downloads
 
Created
Source

OpenTelemetry Elasticsearch Instrumentation for Node.js

NPM version

This module provides automatic instrumentation for @elastic/elasticsearch and follows otel DB Semantic Conventions.

Installation

npm install opentelemetry-instrumentation-elasticsearch

Usage

For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.

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

registerInstrumentations({
  traceProvider,
  instrumentations: [
    new ElasticsearchInstrumentation({
      // see under for available configuration
    })
  ]
});

Elasticsearch Instrumentation Options

Elasticsearch instrumentation has few options available to choose from. You can set the following (all optional):

OptionsTypeDescription
suppressInternalInstrumentationbooleanElasticsearch operation use http/https under the hood. Setting this to true will hide the underlying request spans (if instrumented).
responseHookElasticsearchResponseCustomAttributesFunctionHook called before response is returned, which allows to add custom attributes to span.
dbStatementSerializerDbStatementSerializerElasticsearch instrumentation will serialize db.statement using the specified function.
moduleVersionAttributeNamestringIf passed, a span attribute will be added to all spans with key of the provided moduleVersionAttributeName and value of the patched module version

Please make sure dbStatementSerializer is error proof, as errors are not handled while executing this function.


This extension (and many others) was developed by Aspecto with ❤️

Keywords

FAQs

Package last updated on 04 Mar 2021

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