Spotlight Monitor

raw JSON →
0.5.1 verified Sat May 09 auth: no python

Spotlight Monitor is an AI-powered service monitoring SDK for Python. Version 0.5.1 supports Python >=3.9. It provides decorators and context managers to track service health, latency, and errors, integrating with OpenAI and Anthropic for intelligent alerting. Release cadence is irregular.

pip install spotlight-monitor
error ModuleNotFoundError: No module named 'spotlight'
cause In version 0.5.0, the package name on PyPI changed from 'spotlight' to 'spotlight-monitor', and the import name changed to 'spotlight_monitor'.
fix
Uninstall old package: 'pip uninstall spotlight' and install new: 'pip install spotlight-monitor', then use 'import spotlight_monitor'.
error TypeError: monitor() got an unexpected keyword argument 'alert_provider'
cause The 'alert_provider' parameter was deprecated and removed in version 0.5.0. Use 'integrations' instead.
fix
Replace 'alert_provider="openai"' with 'integrations=["openai"]'.
error AttributeError: module 'spotlight_monitor' has no attribute 'SpotlightClient'
cause In older versions (<0.4.0), the client was named 'Client'. It was renamed to 'SpotlightClient' in 0.4.0.
fix
Use 'SpotlightClient' instead of 'Client'. Alternatively, check the version and update imports accordingly.
breaking Version 0.5.0 changed the default export name from 'spotlight' to 'spotlight_monitor'. Imports using 'import spotlight' will break. Use 'import spotlight_monitor' or 'from spotlight_monitor import ...'.
fix Change all imports to 'spotlight_monitor' instead of 'spotlight'.
deprecated The keyword argument 'alert_provider' is deprecated as of 0.5.0. Use 'integrations' instead.
fix Replace 'alert_provider="openai"' with 'integrations=["openai"]'.
gotcha If you omit the api_key parameter, the monitor will attempt to read SPOTLIGHT_API_KEY from environment variables. If not set, it will silently fall back to a local-only mode without AI features. This can be confusing when you expect AI alerts.
fix Always set SPOTLIGHT_API_KEY or pass api_key explicitly to enable AI features.

Decorate any function to automatically monitor its execution. Set SPOTLIGHT_API_KEY environment variable.

import os
from spotlight_monitor import monitor

@monitor(service="my_service", api_key=os.environ.get('SPOTLIGHT_API_KEY', ''))
def my_function():
    return "Hello, world!"

print(my_function())