{"id":8361,"library":"nv-one-logger-core","title":"NVIDIA One Logger Core","description":"nv-one-logger-core is the foundational logging library within the NVIDIA one-logger ecosystem, providing core logging functionality, including spans, events, and attributes. It enables tracking of GPU application progress and helps identify overhead. The library also integrates with OpenTelemetry (OTEL) for backend telemetry. The current version is 2.3.1, with recent releases indicating an active development cadence.","status":"active","version":"2.3.1","language":"en","source_language":"en","source_url":"https://github.com/NVIDIA/nv-one-logger","tags":["logging","telemetry","opentelemetry","nvidia","gpu","mlops"],"install":[{"cmd":"pip install nv-one-logger-core","lang":"bash","label":"Install latest version"},{"cmd":"pip install nv-one-logger-core==2.3.1","lang":"bash","label":"Install specific version"}],"dependencies":[{"reason":"Used for robust enum types.","package":"strenum","optional":false},{"reason":"Provides backported and experimental typing features.","package":"typing-extensions","optional":false}],"imports":[{"note":"The top-level package is `nv_one_logger`, and core components are under `nv_one_logger.core`.","wrong":"from nv_one_logger_core import Logger","symbol":"Logger","correct":"from nv_one_logger.core.api import Logger"},{"note":"Core API elements like Span are directly under `nv_one_logger.core.api`.","wrong":"from nv_one_logger_core.Span import Span","symbol":"Span","correct":"from nv_one_logger.core.api import Span"},{"note":"OpenTelemetry specific configurations are located in the `otel` submodule.","symbol":"OTELConfig","correct":"from nv_one_logger.otel.config import OTELConfig"},{"note":"Function to configure OpenTelemetry integration.","symbol":"configure_otel","correct":"from nv_one_logger.otel.api import configure_otel"}],"quickstart":{"code":"import os\nfrom nv_one_logger.core.api import Logger, Span\nfrom nv_one_logger.otel.api import configure_otel\nfrom nv_one_logger.otel.config import OTELConfig\n\n# Configure OpenTelemetry to export to console for demonstration\notel_config = OTELConfig(\n    exporter_type='console', # Options: 'console', 'otlp_grpc', 'otlp_http'\n    service_name='my-application',\n    endpoint=os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT', '') # Set if using otlp_grpc or otlp_http\n)\nconfigure_otel(otel_config)\n\n# Get a logger instance\nlogger = Logger.get_logger(\"my_app_logger\")\n\n# Log a simple message\nlogger.info(\"Application started.\")\n\n# Create a span to track an operation\nwith Span.create(\"process_data\", logger=logger) as span:\n    span.set_attribute(\"input_size\", 100)\n    logger.debug(\"Processing data...\")\n    # Simulate some work\n    result = sum(range(100))\n    span.set_attribute(\"output_result\", result)\n    logger.info(\"Data processed successfully.\")\n\nlogger.info(\"Application finished.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the nv-one-logger-core with OpenTelemetry console exporter, create a logger, and use spans to track operations. The `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable can be set for OTLP exporters."},"warnings":[{"fix":"Upgrade to `nv-one-logger-core` version 2.5.0 or later if available, and ensure any dependent libraries like `nv-one-logger-training-telemetry` are also updated to versions that incorporate this fix. (Note: Current `nv-one-logger-core` is 2.3.1, implying a subsequent release will address this).","message":"Older versions (prior to 2.5.0) of the underlying `nv-one-logger` system, which `nv-one-logger-core` is part of, had a 'Too many open files' (`OSError: [Errno 24]`) issue, particularly when integrated with frameworks like NeMo, due to file handlers not being correctly closed.","severity":"breaking","affected_versions":"<2.5.0"},{"fix":"Ensure `nv-one-logger` is correctly initialized and enabled in all relevant processes/ranks. If logging is intentionally disabled, consider conditionally calling `nv-one-logger` APIs or adjusting framework integrations to avoid unnecessary calls.","message":"When `nv-one-logger` is disabled or not properly initialized in an environment (e.g., specific distributed training ranks), you might encounter 'Skipping execution of X because OneLogger is not enabled.' warnings. This indicates that instrumentation calls are being made without an active logger.","severity":"gotcha","affected_versions":"All"},{"fix":"Refer to the NVIDIA GitHub repository (NVIDIA/nv-one-logger) for the authoritative project structure and usage patterns to avoid confusion with unrelated libraries.","message":"The PyPI description 'Extensions to onelogger library' might be misleading. `nv-one-logger-core` is a core component of the `NVIDIA/nv-one-logger` project, which includes its own OpenTelemetry integration (`nv_one_logger.otel`), and is distinct from other Python 'onelogger' projects (e.g., realsdx/onelogger).","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"This issue was reported to be fixed in versions 2.5.0+. Upgrade `nv-one-logger-core` and any dependent `nv-one-logger` components (e.g., `nv-one-logger-training-telemetry`) to their latest available versions that include the fix.","cause":"File descriptors for internal log files are not being correctly closed, leading to resource exhaustion, particularly in long-running applications or distributed training jobs.","error":"OSError: [Errno 24] Too many open files: '/path/to/onelogger.err'"},{"fix":"Verify the logging configuration and ensure `configure_otel()` (or equivalent initialization for other backends) is called and `OneLogger` is globally enabled before calls to its APIs. In distributed setups, ensure all processes correctly initialize the logger.","cause":"An `nv-one-logger` API or callback (e.g., `on_train_start` from an integration) is being invoked when the OneLogger system has not been fully initialized or is explicitly disabled.","error":"WARNING - Skipping execution of on_train_start because OneLogger is not enabled."},{"fix":"Adjust import statements to use `from nv_one_logger.core.<submodule> import ...` or `from nv_one_logger.otel.<submodule> import ...` based on the specific component you need.","cause":"Attempting to import modules or classes directly from 'nv_one_logger_core' as if it were the top-level package. The correct top-level package is `nv_one_logger`.","error":"ModuleNotFoundError: No module named 'nv_one_logger_core'"}]}