---
title: Send logs and events from Python apps to Honeybadger Insights
description: Here's how to integrate your Python apps with Honeybadger Insights.
url: https://docs.honeybadger.io/guides/insights/integrations/python/
---

When enabled, Honeybadger [automatically instruments your Python application](https://docs.honeybadger.io/lib/python/insights/automatic-instrumentation/) to send application events to Honeybadger Insights. This is the easiest way to get started with Insights. To get started, enable Insights in your app configuration:

```python
from honeybadger import honeybadger


honeybadger.configure(insights_enabled=True)
```

Once integrated with our middleware or extensions, Honeybadger instruments the following libraries:

* **Django** requests & database queries
* **Flask** requests & database queries
* **ASGI** requests (FastAPI, Starlette, etc.)
* **Celery** tasks
* **Oban** workers & maintenance loops

See the [automatic instrumentation guide](https://docs.honeybadger.io/lib/python/insights/automatic-instrumentation/) to learn how to configure each integration, and the [Python event reference](https://docs.honeybadger.io/insights/event-types/python/) for every event the package emits, with field schemas and types. You can also [add extra context data](https://docs.honeybadger.io/lib/python/insights/event-context/) to events, [filter events](https://docs.honeybadger.io/lib/python/insights/filtering-events/) to remove PII, and [sample events](https://docs.honeybadger.io/lib/python/insights/sampling-events/) to reduce the amount of data sent to Honeybadger.

## Querying events with BadgerQL

Once events are flowing into Insights, you can query them with [BadgerQL](https://docs.honeybadger.io/guides/insights/badgerql/). For example, to find your slowest Django views:

```plaintext
filter event_type::str == "django.request"
| stats avg(duration::float) as avg_duration, count() as requests by view::str
| sort avg_duration desc
```

Or to see Oban background-job throughput and p95 duration by worker:

```plaintext
filter event_type::str == "oban.job_finished"
| stats count() as jobs, percentile(95, duration::float) as p95_ms by worker::str
| sort jobs desc
```

The [Python event reference](https://docs.honeybadger.io/insights/event-types/python/) lists the fields available on each event type.

## Sending custom events

If you have custom events you’d like to track, use `honeybadger.event` to report them to Insights:

```python
from honeybadger import honeybadger


honeybadger.event("user.signup", {"user_id": user.id, "plan": user.plan})
```

More information about sending events to Insights from your Python apps can be found [here](https://docs.honeybadger.io/lib/python/insights/sending-custom-events/).

## Sending logs from your infrastructure

Honeybadger isn’t just for errors and application data! You can use our [syslog](https://docs.honeybadger.io/guides/insights/integrations/systemd/), [Vector](https://docs.honeybadger.io/guides/insights/integrations/log-files/), or [PaaS integrations](https://docs.honeybadger.io/guides/insights/#adding-data-from-other-sources) to send additional data from your infrastructure to [Honeybadger Insights](https://docs.honeybadger.io/guides/insights/), where you can query, visualize, and analyze all of your production data in one place.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
