Lumigo Core Utilities
Lumigo-core is an internal utility library providing core functionalities for other Lumigo Python packages, primarily the Lumigo Python tracers. It contains common utilities for environment detection, configuration, and reporting, designed to operate within the context of AWS serverless environments. It is not typically intended for direct end-user application development but is an essential dependency for Lumigo's observability tools. The current version is 0.0.16, and releases are tied to the needs of the Lumigo tracer libraries.
Common errors
-
ModuleNotFoundError: No module named 'lumigo_core.x'
cause Attempting to import a submodule or symbol that does not exist in `lumigo-core` or is located in another Lumigo library (e.g., `lumigo-tracer`).fixVerify the exact module path from the source code or official documentation of `lumigo-core`. If you're looking for tracing features, ensure `lumigo-tracer` is installed and you're importing from it. -
AttributeError: 'Configuration' object has no attribute 'some_setting'
cause Trying to access a configuration setting that doesn't exist or isn't intended for direct modification, or a setting that's only initialized by the Lumigo tracer.fixConsult the `lumigo_core/configuration.py` source code to see available settings. For general Lumigo configuration, refer to the `lumigo-tracer` documentation, as many settings are managed there.
Warnings
- gotcha Lumigo-core is primarily an internal dependency. Most direct usage is not officially supported or documented for end-users. It's designed to be consumed by other Lumigo libraries (e.g., `lumigo-tracer`), which handle its initialization and context.
- gotcha Version compatibility between `lumigo-core` and `lumigo-tracer` (or other Lumigo libraries) is critical. Mismatched versions can lead to unexpected behavior or runtime errors.
Install
-
pip install lumigo-core
Imports
- is_aws_environment
from lumigo_core.utils import is_aws_environment
- get_region
from lumigo_core.utils import get_region
- Configuration
from lumigo_core.configuration import Configuration
Quickstart
from lumigo_core.utils import is_aws_environment, get_region
import os
# lumigo-core is primarily an internal utility.
# Direct 'quickstarts' are uncommon.
# This demonstrates accessing a basic utility function.
print(f"Is running in AWS environment? {is_aws_environment()}")
print(f"Detected AWS region: {get_region()}")
# Example of how configuration might be accessed (internal use usually):
from lumigo_core.configuration import Configuration
Configuration.lumigo_debug_mode = True
print(f"Lumigo Debug Mode: {Configuration.lumigo_debug_mode}")