Commit Graph

1119 Commits

Author SHA1 Message Date
Klaas van Schelven 073bc7aaec make_consistent: add --dry-run 2025-02-19 12:06:16 +01:00
Klaas van Schelven f4250d2db8 make_consistent: document possible way forward 2025-02-19 11:56:21 +01:00
Klaas van Schelven 92425890cd make_consistent: take 'points to missing' into account while deleting
also: switch a number of deletions from in-the-loop deletions to
delete-using-sql.
2025-02-19 11:42:44 +01:00
Klaas van Schelven 918b1ef54c Add ids to 2 system-checks 2025-02-18 12:10:32 +01:00
Klaas van Schelven 3cb07246b9 Add system-check for EVENT_STORAGES setting 2025-02-18 12:08:05 +01:00
Klaas van Schelven 10f8e10607 DB indexes for the issue-lits (including filters)
simply by reasoning about what they should be; no performance testing (on the issue-list
and on the event-ingestion) was done for these)
2025-02-18 10:32:06 +01:00
Klaas van Schelven 2cb87f8334 Issues list pagination 2025-02-18 09:47:30 +01:00
Klaas van Schelven 7b32e71e1c Merge pull request #45 from bugsink/dependabot/pip/python-packages-8f6e7d9701
Update sentry-sdk requirement from ==2.21.* to ==2.22.*
2025-02-17 21:44:02 +01:00
Klaas van Schelven 14bc3688c7 retention: deletion counts, more defensive idiom
the dict as returned by Django won't contain 'events.Event' if none are deleted;
no observed bug for this line, but good measure to fix it anyway
2025-02-17 21:36:08 +01:00
Klaas van Schelven 3a1fe9acec allow long-running queries on 'nuke' and 'make_consistent' 2025-02-17 21:32:39 +01:00
Klaas van Schelven 5766fb8485 Make_consistent: run in a transaction
'Nice consistency you got here. Be a shame if anything happened to it.'
2025-02-17 21:11:44 +01:00
Klaas van Schelven e37274c9aa nuke_events: improvements
* better name
* better confirmation box
* more complete deletion (turning points, groupings)
* run in transaction
2025-02-17 21:00:12 +01:00
dependabot[bot] 9b3e810950 Update sentry-sdk requirement in the python-packages group
Updates the requirements on [sentry-sdk](https://github.com/getsentry/sentry-python) to permit the latest version.

Updates `sentry-sdk` to 2.22.0
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.21.0...2.22.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  dependency-group: python-packages
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 16:10:10 +00:00
Klaas van Schelven 443014f0b1 Dead code removal
this comment was added for-reference, was accidentally checked in
2025-02-17 16:45:10 +01:00
Klaas van Schelven bab889cd84 transaction semaphore: ensure release for exceptions while _entering_ the transaction
Similar to 415da94093b0; but this time focussing on potential problems in `__enter__`.
i.e. `BEGIN IMMEDIATE` (or `BEGIN`) can _also_ fail for whatever reason, which
is yet another case where the semaphore should be released.

Rather than wrapping more parts of code (in this case, in `__enter__`) with try/except,
this made it clear to me that a separation of concerns was in order. Simply making 2
context processors, and stacking those is more transparently correct. As per the quoted
SO answer:

> Don't re-invent the wheel; this is not as simple as it looks.
2025-02-17 15:43:50 +01:00
Klaas van Schelven ff11b29e1b MoreLoudlyFailingTransport: avoid infinite recursion
since logger.error tries to use sentry in typical setups, using that to report
trouble with sentry is not a good idea
2025-02-17 15:31:04 +01:00
Klaas van Schelven fad34de68f Move MoreLoudlyFailingTransport out of the default 'eat_your_own_dogfood' conf
it's an extra convinience function for Bugsink developers (me), but the
less stability/more ergonomics tradeoff is not right in the general
case of running Bugsink

(for an example of an actually materializing stability problem, see the
upcoming commit)
2025-02-17 15:27:55 +01:00
Klaas van Schelven 97e54868c9 showstat: warning about eviction 2025-02-17 13:41:21 +01:00
Klaas van Schelven b4bf6d01c3 Make import lazy for performance reasons ('cold start') 2025-02-17 13:31:03 +01:00
Klaas van Schelven 5263980f54 showstat: digestion_speed 2025-02-17 13:21:41 +01:00
Klaas van Schelven d3342f2671 Rename to event-storage for consistency 2025-02-14 17:08:04 +01:00
Klaas van Schelven 212882e65d Add cleanup_eventstorage command 2025-02-14 17:06:56 +01:00
Klaas van Schelven bfd6610f83 Add migrate_to_current_eventstore command 2025-02-14 14:34:29 +01:00
Klaas van Schelven 4c4d589f2b Fix on ac3badbdb1 2025-02-14 12:25:10 +01:00
Klaas van Schelven 6f4acf216e Show message.message in event details
Fix #43
2025-02-14 12:20:56 +01:00
Klaas van Schelven ac3badbdb1 Logentry: show in event-details
it's useful info (and the now-removed comment was also untrue)
2025-02-14 11:35:38 +01:00
Klaas van Schelven 01325ae0f3 Add migrate command that always shows timings 2025-02-14 10:15:23 +01:00
Klaas van Schelven 3ccef7fd50 FileEventStorage: create dir on-demand; fix and add tests 2025-02-12 21:19:18 +01:00
Klaas van Schelven 7109ddeade tag test as 'samples'
it's calling a test that so-tagged, so logically it should also be
2025-02-12 20:54:41 +01:00
Klaas van Schelven b5a52c520e Merge pull request #41 from bugsink/dependabot/pip/python-packages-ff8e99c6b1
Update sentry-sdk requirement from ==2.20.* to ==2.21.*
2025-02-12 17:16:17 +01:00
Klaas van Schelven 5559fba754 Introduce FileEventStorage
An (optional) way to store the `event_data` (full event as JSON)
outside the DB. This is expected to be useful for larger setups,
because it gives you:

* A more portable database (e.g. backups); (depeding on event size
  the impact on your DB is ~50x.
* Less worries about hitting "physical" limits (e.g. disk size, max
  file size) for your DB.

Presumably (more testing will happen going forwards) it will:

* Speed up migrations (especially on sqlite, which does full table
  copies)
* Speed up event ingestion(?)

Further improvements in this commit:

* `delete_with_limit` was removed; this removes one tie-in to MySQL/Sqlite
    (See #21 for this bullet)
2025-02-12 17:11:24 +01:00
dependabot[bot] 910a4ea8ac Update sentry-sdk requirement in the python-packages group
Updates the requirements on [sentry-sdk](https://github.com/getsentry/sentry-python) to permit the latest version.

Updates `sentry-sdk` to 2.21.0
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/2.20.0...2.21.0)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  dependency-group: python-packages
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-12 16:09:26 +00:00
Klaas van Schelven aa4aba7edf MAX_EVENTS: set very high in devevelopment settings 2025-02-12 16:23:56 +01:00
Klaas van Schelven 4a8bb25c63 clarify a comment 2025-02-12 13:45:16 +01:00
Klaas van Schelven 4921f5a05d Remove retention/eviction test-scripts
we've been having 'the real thing' for a while, no more need for
'scaffolding'
2025-02-12 09:55:28 +01:00
Klaas van Schelven b3eb5acc04 Retention/eviction: add a minimal test 2025-02-12 09:53:36 +01:00
Klaas van Schelven 9f61602fc1 Retention, internal: make max_event_count non-optional
It was optional in anticipation of other methods of eviction, but YAGNI,
and the idea of evicting in batches of 500 is baked in quite hard (for
good reasons).
2025-02-12 09:00:12 +01:00
Klaas van Schelven 1ef31f2028 CHANGELOG formatting 2025-02-11 20:24:13 +01:00
Klaas van Schelven 14d8e9e2fb Fix: remove missed line
Should have been removed in cc861c8ba3
1.2.0
2025-02-11 11:00:23 +01:00
Klaas van Schelven 96a9b2ef3b Add changelog 2025-02-11 10:52:53 +01:00
Klaas van Schelven cc861c8ba3 Remove 2 fields that were "temporary [..] to get a sense of the shape of the data 2025-02-09 21:12:25 +01:00
Klaas van Schelven 87936a566f Docker: Use /data/ as the default directory for the sqlite database
Creating the directory (with a warning message about 'throwaway') if needed
See #10
2025-02-08 22:41:03 +01:00
Klaas van Schelven a717dd7374 Truncate input-data that exceeds max_length
Avoiding any (1406, "Data too long for column ...") on MySQL.

For the 'plainly provided' fields I followed the documented maximums which are
also our DB maximums. For calculated_* I harmonized with what Sentry &
GlitchTip both do (and which was already partially reflected in the code), i.e.
128 and 1024.
2025-02-08 21:21:55 +01:00
Klaas van Schelven 5e6413d793 Merge pull request #38 from dependabot
Update whitenoise requirement from ==6.8.* to ==6.9.* in the python-packages group
2025-02-07 17:14:55 +01:00
Klaas van Schelven 561c1d324a event.data getters
in preparation for scenarios where the dumped data is not stored in the DB
2025-02-07 17:09:36 +01:00
Klaas van Schelven 1a3e3d0189 Remove dead code
accidentally checked in earlier (was pasted in test for reference)
2025-02-07 16:52:42 +01:00
dependabot[bot] 88a07d2f62 Update whitenoise requirement in the python-packages group
Updates the requirements on [whitenoise](https://github.com/evansd/whitenoise) to permit the latest version.

Updates `whitenoise` to 6.9.0
- [Changelog](https://github.com/evansd/whitenoise/blob/main/docs/changelog.rst)
- [Commits](https://github.com/evansd/whitenoise/compare/6.8.0...6.9.0)

---
updated-dependencies:
- dependency-name: whitenoise
  dependency-type: direct:production
  dependency-group: python-packages
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-07 15:25:58 +00:00
Klaas van Schelven 51fced662a Add event_count showstat 2025-02-07 11:13:15 +01:00
Klaas van Schelven b131b031d3 Fix comment
caused by copy/paste error with the immediate_atomic decorator which
is below in the same file.
2025-02-07 10:35:30 +01:00
Klaas van Schelven 19aa439339 reword comment slightly 2025-02-07 10:21:20 +01:00