{"id":24126,"library":"nucliadb-telemetry","title":"NucliaDB Telemetry","description":"Telemetry library for NucliaDB processes. Provides OpenTelemetry-based tracing, metrics, and logging with Sentry integration. Current version 6.13.0.post6185, frequent releases.","status":"active","version":"6.13.0.post6185","language":"python","source_language":"en","source_url":"https://github.com/nuclia/nucliadb","tags":["telemetry","opentelemetry","sentry","logging","nucliadb"],"install":[{"cmd":"pip install nucliadb-telemetry","lang":"bash","label":"stable"}],"dependencies":[{"reason":"Core dependency for OpenTelemetry tracing and metrics","package":"opentelemetry-api","optional":false},{"reason":"For error reporting and performance monitoring","package":"sentry-sdk","optional":true}],"imports":[{"note":"Public API is at package level, not submodule","wrong":"from nucliadb_telemetry.telemetry import Telemetry","symbol":"Telemetry","correct":"from nucliadb_telemetry import Telemetry"},{"note":"utils is a module; import it, then access functions via utils.XXX","wrong":"from nucliadb_telemetry.utils import some_func","symbol":"utils","correct":"from nucliadb_telemetry import utils"}],"quickstart":{"code":"import os\nfrom nucliadb_telemetry import Telemetry\n\n# Use environment variables for configuration\nservice_name = os.environ.get('SERVICE_NAME', 'my-service')\nsettings = {\n    'sentry_dsn': os.environ.get('SENTRY_DSN', ''),\n    'service_name': service_name,\n}\ntelemetry = Telemetry(settings)\ntelemetry.setup()  # initializes tracing, metrics, logging","lang":"python","description":"Initialize telemetry with Sentry and OpenTelemetry. Settings dict configures endpoints and service name."},"warnings":[{"fix":"Review settings dict: use 'logging': {'level': 'DEBUG'} instead of top-level 'log_level'.","message":"Settings dict structure changed in v6.10.0: 'sentry_dsn' renamed from 'sentry_dsn' (remains same) but 'log_level' moved to a nested dict under 'logging'. Check changelog.","severity":"breaking","affected_versions":">=6.10.0"},{"fix":"Consider setting SENTRY_DSN='' for local development, or run setup in background thread.","message":"Telemetry.setup() may block if Sentry DSN is set but unreachable. Network timeouts can delay startup.","severity":"gotcha","affected_versions":"all"},{"fix":"Set env var OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 or configure in settings.","message":"OpenTelemetry spans may not appear if no exporter is configured. The library defaults to a console exporter for debugging; production requires setting OTEL_EXPORTER_OTLP_ENDPOINT.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install nucliadb-telemetry[otel]  # or pip install opentelemetry-api opentelemetry-sdk","cause":"Missing optional dependency opentelemetry-api","error":"ModuleNotFoundError: No module named 'opentelemetry'"},{"fix":"from nucliadb_telemetry import Telemetry","cause":"Wrong import path; Telemetry is not in a submodule but directly in package","error":"ImportError: cannot import name 'Telemetry' from 'nucliadb_telemetry'"},{"fix":"Pass settings = {'logging': {'level': 'INFO'}} instead of {'log_level': 'INFO'}","cause":"Breaking change in v6.10.0: log_level moved to nested 'logging' dict","error":"TypeError: Telemetry.__init__() got an unexpected keyword argument 'log_level'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}