Lumigo Tracer for Python

raw JSON →
1.1.257 verified Mon Apr 27 auth: no python

A Python tracing library for serverless and distributed applications, providing automatic instrumentation for AWS Lambda and other runtimes. Version 1.1.257, updated frequently. It wraps AWS SDK calls, HTTP requests, and other libraries to send telemetry to the Lumigo observability platform.

pip install lumigo-tracer
error ModuleNotFoundError: No module named 'lumigo_tracer'
cause Library not installed or environment missing it.
fix
Install with pip install lumigo-tracer and ensure the Lambda layer includes it.
error AttributeError: module 'lumigo_tracer' has no attribute 'lumigo_tracer'
cause Incorrect import path: probably used `from lumigo_tracer import lumigo_tracer` but the package is installed as `lumigo-tracer` vs `lumigo_tracer`? Or installed wrong package.
fix
Use from lumigo_tracer import lumigo_tracer and ensure the correct package is installed.
error TypeError: lumigo_tracer() got an unexpected keyword argument 'timeout_seconds'
cause Using old API where timeout_seconds was allowed; removed in newer versions.
fix
Remove timeout_seconds argument; the tracer now uses Lambda's configured timeout.
breaking The import from `lumigo` (without `_tracer`) is deprecated and will be removed. Use `from lumigo_tracer import lumigo_tracer`.
fix Change import statement to `from lumigo_tracer import lumigo_tracer`.
deprecated The `lumigo_tracer` decorator no longer supports `timeout_seconds` parameter. It now infers timeout from Lambda configuration.
fix Remove `timeout_seconds` argument from the decorator.
gotcha If you don't set `LUMIGO_TOKEN` environment variable, tracing will silently fail. The token must be present at startup.
fix Set the `LUMIGO_TOKEN` environment variable with your Lumigo token.
gotcha The tracer wraps many common libraries (requests, boto3, pymongo, etc.) automatically. If you use an unsupported library, you must manually create spans.
fix Check the Lumigo docs for supported libraries; use `lumigo_tracer.add_execution_tag()` for manual instrumentation.

Decorate your Lambda handler with @lumigo_tracer and set the LUMIGO_TOKEN environment variable.

import os
from lumigo_tracer import lumigo_tracer

@lumigo_tracer(token=os.environ.get('LUMIGO_TOKEN', ''))
def lambda_handler(event, context):
    return {'statusCode': 200, 'body': 'Hello from Lumigo!'}