Elasticsearch
Elasticsearch is a popular search and analytics engine. The AppSignal for Node.js integration for Elasticsearch provides automatic instrumentation for the Elasticsearch Node.js client.
Installation
The Elasticsearch Node.js client includes instrumentation via OpenTelemetry. It will automatically report data to the AppSignal for Node.js package. No additional setup is required to instrument Elasticsearch in your application.
Features
The built-in instrumentation captures spans for search queries, index operations, and other interactions with your Elasticsearch cluster. The integration will send AppSignal spans representing the execution time of each Elasticsearch API call with information about the operation.
Configuration
You can disable the instrumentation of Elasticsearch by:
-
setting an environment variable;
ShellOTEL_ELASTICSEARCH_ENABLED=false
-
using a custom
Transport
.app.tsimport { Transport, TransportRequestOptions, TransportRequestParams, } from "@elastic/transport"; class CustomTransport extends Transport { async request( params: TransportRequestParams, options: TransportRequestOptions = {} ): Promise<any> { options.openTelemetry = { enabled: false }; return super.request(params, options); } } const client = new Client({ /* your client config... */ Transport: CustomTransport, });
You can also leave the instrumentation enabled and disable it for a single API call by passing a custom TransportRequestOptions
object as the second argument to any API call:
const response = await client.search({ ... }, { openTelemetry: { enabled: false }, });