Skip to main content
If your application logs Error sending events., start with the error already in your application logs. Python SDK 1.4.42 and later include a reason and a batch size with verbose logging off. Check the version in the environment that runs your application with python -m pip show lunary.

Read a production error

Leave LUNARY_VERBOSE unset or set it to false. The lunary logger defaults to WARNING, and its child lunary.consumer logs event delivery failures at ERROR. Your application’s Python logging handlers can capture these records alongside your other logs. If you configure log filtering, include lunary.consumer at ERROR and keep the timestamp and timezone.
Here, the endpoint returned HTTP 429 for a request containing two events. The SDK removed that batch from its in-memory queue before sending it and will not send it again. One failed batch produces one error line, even when it contains many events. http_status=n/a means the SDK has no HTTP error status to report. For example, a read timeout can occur after the server received the batch, so the event count alone cannot tell you how many events were lost. If an older SDK prints only Error sending events., use the timestamp to look up the request to /v1/runs/ingest in your gateway or ingestion logs. For hosted Lunary, share the timestamp, timezone and SDK version with support. Upgrading adds the reason to future errors.

HTTP responses

Failures without an HTTP status

Trace batch activity without logging event contents

If errors are quiet but traces seem delayed, you can watch the worker in a short diagnostic run. Start with verbose mode off, then enable DEBUG on the consumer logger only. In an application that already configures logging, use its existing handler and make sure its level admits DEBUG from lunary.consumer.
Run one monitored operation. A successful send can produce the following messages (formatter prefixes omitted).
The first line shows that the worker picked up a batch. The second shows the configured API base URL. The last shows that the request completed with HTTP 200. The worker does not inspect per-event results in the response. If the dashboard still looks empty, check the project and time filter and correlate the send time with ingestion logs. Review any custom endpoint URL before sharing these lines.

Use verbose logging for one reproduction

For a serialized event or a send traceback, start a fresh process with LUNARY_VERBOSE=true before importing lunary. Both true and True enable this behavior. Run your own reproduction script against a test project with synthetic input.
At startup the SDK adds a DEBUG handler that writes to stderr and turns off propagation from lunary to the root logger. Look for Add event: followed by serialized event data, then the consumer’s batch messages. Add event: means the event was queued. A failed send also includes a Python traceback. To return to normal logging, end that process and start the application with the variable unset or false. In a running application, lunary.config(verbose=True) enables send-error tracebacks and the SDK’s event-debug code. The existing logger and handler levels still control whether DEBUG records appear. This call does not install the startup stderr handler. If your application passes a custom ssl_verify setting, retain it when calling config. Changing a logger level alone does not enable verbose event serialization or send-error tracebacks. Verbose output can include prompts, model outputs, user metadata, endpoint URLs and an explicitly supplied event key. Share the standard delivery error line for production investigations. Review and redact any verbose output or traceback before sharing it.

Recognize tracking and integration messages

When asking support to investigate, include the SDK version, timestamp with timezone, whether you use hosted or self-hosted Lunary, and the exact standard error line. For an integration error, include the provider and client version as well. Keep API keys and event contents out of the report.