Installation

View as Markdown

Install NeMo Lens using pip, with optional telemetry support depending on your development requirements.

Basic Install

pip install nemo-lens

This command pulls in only opentelemetry-api, the no-op implementation. Instrumented code runs correctly but no spans or metrics are exported. Useful for library authors who want to instrument code without forcing downstream users to install the SDK.

Install with OTel SDK and OTLP Exporters

pip install 'nemo-lens[sdk]'

Adds opentelemetry-sdk and the OTLP exporters (opentelemetry-exporter-otlp-proto-grpc, opentelemetry-exporter-otlp-proto-http). Required on any rank that actually exports telemetry.

Install Framework Contrib Extras

pip install 'nemo-lens[fastapi]' # FastAPI server auto-instrumentation
pip install 'nemo-lens[aiohttp]' # aiohttp client auto-instrumentation

Each adds the relevant OTel instrumentation package. See Contrib Helpers for details.

Install for Development

git clone <repo-url>
cd lens
pip install --group dev -e .
pre-commit install

The dev dependency group includes the SDK, pytest, pytest-cov, pre-commit, and Ruff. See Developer Guide.

Python Support

nemo-lens requires Python ≥ 3.10, matching the floor of opentelemetry-api and opentelemetry-sdk. CI tests 3.10 through 3.13.

Packaging Notes

nemo.lens is a PEP 420 namespace package, so it coexists peacefully with NeMo Framework’s nemo.* packages. The src/nemo/__init__.py file contains only an explanatory comment (no code), so it does not shadow other nemo.* packages on the path.