skillfed

opentelemetry-instrumentation-elasticsearch

OpenTelemetry elasticsearch instrumentation

opentelemetry-instrumentation-elasticsearch v0.64b0 3.5M downloads/30d#2,597 on PyPI1,086
Permissive license Apache-2.0 Active released

What it is and what it does

This package integrates Elasticsearch query tracing into OpenTelemetry, the industry standard for distributed observability. When installed and activated, it automatically captures telemetry data from all Elasticsearch operations made through the elasticsearch library—query details, response times, and errors—and exports them to your configured OpenTelemetry backend. It's part of the broader OpenTelemetry ecosystem and works alongside other instrumentation packages to give you end-to-end visibility into your application's database interactions.

The package wraps the elasticsearch library using wrapt and relies on opentelemetry-instrumentation to handle the instrumentation lifecycle. It emits semantic conventions defined by opentelemetry-semantic-conventions, ensuring your traces follow industry standards. Installation is straightforward and it supports Python versions 3.10, 3.11, 3.12, 3.13, and 3.14.

Use it for:

  • Trace Elasticsearch queries in microservices to identify slow or failing database operations across distributed systems.
  • Monitor Elasticsearch performance in production by exporting traces to a backend.
  • Debug application issues by correlating Elasticsearch query traces with logs and metrics from other instrumented services.
  • Analyze query patterns and latency distribution to optimize Elasticsearch usage and identify bottlenecks.
  • Ensure compliance and audit requirements by capturing detailed Elasticsearch operation telemetry.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds distributed tracing to Elasticsearch queries made via the elasticsearch library, capturing request and response telemetry for OpenTelemetry-compatible observability platforms.

Yes, if you already use OpenTelemetry and the elasticsearch library. The package is actively maintained, has no known vulnerabilities, and low install friction. It is in beta (0.64b0) but widely used (top 5000 PyPI packages). Install it only if you have an OpenTelemetry collector or exporter configured; without one, instrumentation will run but produce no actionable output.

Install

opentelemetry-instrumentation-elasticsearch on PyPI

pip

pip install opentelemetry-instrumentation-elasticsearch

uv

uv add opentelemetry-instrumentation-elasticsearch

poetry

poetry add opentelemetry-instrumentation-elasticsearch

Installing opentelemetry-instrumentation-elasticsearch

Before you install

Low friction installation with four stable runtime dependencies (opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, wrapt). Package is actively maintained with recent releases and no known vulnerabilities.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production environments.

Quickstart

pip install opentelemetry-instrumentation-elasticsearch

from opentelemetry.instrumentation.elasticsearch import ElasticsearchInstrumentor

ElasticsearchInstrumentor().instrument()

Requires Python >=3.10; elasticsearch library must be installed separately for instrumentation to take effect.

Verify before relying

  • Whether instrumentation works with all elasticsearch-py versions or has specific version constraints.
  • Performance overhead of tracing on typical Elasticsearch workloads.
  • Compatibility with specific OpenTelemetry exporters and backends.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, wrapt
Maintenance actively maintained — 51 days since the last release
Last repo commit
First released
Downloads 3,508,006/month — #2,597 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_instrumentation_elasticsearch-0.64b0-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

elasticsearch tracing instrumentationopentelemetry elasticsearchdistributed tracing elasticsearchelasticsearch observabilityelasticsearch query tracingopentelemetry instrumentationelasticsearch monitoring
observabilitytracingelasticsearch

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-aws-lambda

Instruments AWS Lambda functions to emit…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-cassandra

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

elastic-opentelemetry

Elastic's customized distribution of…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-remoulade

Adds distributed tracing instrumentation for…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-sklearn

Adds distributed tracing instrumentation to…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-aiohttp-client

Adds distributed tracing to HTTP requests made…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-pymongo

Adds automatic tracing and observability…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-redis

Adds distributed tracing to Redis client calls…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-botocore

Adds distributed tracing to AWS SDK calls made…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-starlette

Adds automatic tracing and observability…

permissive · top 5,000 on PyPI