Commit Graph

95 Commits

Author SHA1 Message Date
Klaas van Schelven
1eea9268a5 Optimization: Search on EvenTag without involving Event if possible
When searching by tag, there is no need to join with Event; especially when
just counting results or determining first/last digest_order (for navigation).

(For the above "no need" to be actually true, digest_order was denormalized
into EventTag).

The above is implemented in `search_events_optimized`.

Further improvements:

* the bounds of `digest_order` are fetched only once; for first/last this info
  is reused.

* explicitly pass `event_qs_count` to the templates

* non-event pages used to calculate a "last event" to generate a tab with a
  correct event.id; since we simply have the "last" idiom, better use that.
  this also makes clear the "none" idiom was never needed, we remove it again.

Results:

Locally (60K event DB, 30K events on largest issue) my testbatch now
runs in 25% of time (overall).

* The effect on the AND-ing are in fact very large (13% runtime remaining)
* The event details page is not noticably improved.
2025-03-12 20:38:07 +01:00
Klaas van Schelven
b031792784 Event (tag) search: performance improvement
Done by denormalizing EventTag.issue, and adding that into an index. Targets:

* get-event-within-query (when it's 'last' or 'first')
* .count (of search query results)
* min/max (for the first/prev/next/last buttons)

(The min/max query's performance significantly improved by the addition of
the index, but was also rewritten into a simple SELECT rather than MIN/MAX).

When this code was written, I thought I had spectacularly improved performance.
I now believe this was based on an error in my measurements, but that this
still represents (mostly) an improvement, so I'll let it stand and will take
it from here in subsequent commits.
2025-03-12 14:11:43 +01:00
Klaas van Schelven
f548eab778 Merge branch 'main' into tag-search 2025-03-10 09:09:40 +01:00
Klaas van Schelven
39bddb14b7 handled: searchable as a tag
also: don't display this in the detail view when the value isn't actually
in the data
2025-03-06 15:19:55 +01:00
Klaas van Schelven
646b1ea090 Details page: be robust for top-level message-as-string
Fix #55
2025-03-06 13:09:29 +01:00
Klaas van Schelven
20a54381dc Refactor: move tags/search stuff to its own module 2025-03-06 09:26:35 +01:00
Klaas van Schelven
4cde74d7cb Event search: first version 2025-03-04 13:51:56 +01:00
Klaas van Schelven
0cbdae9411 _get_events helper: clarify edge-cases
In b76e474ef1, the event-navigation was changed into the next/prev idiom (I
think completely, i.e. also from the .html files, but did not check) but the
elif structure and error message did not fully reflect that (it still talked
about digest_order/id, but nav is now one of the primary methods)

I briefly considered removing the lookup-by-digest-order-only, but I figure it
may come in handy at some point (if only for users to directly edit the url)
and did not check whether this is actually unused.
2025-03-04 09:59:03 +01:00
Klaas van Schelven
a00a815261 Merge branch 'main' into tag-search 2025-03-03 15:02:13 +01:00
Klaas van Schelven
5930740e0b Tags: as a separate tab 2025-03-03 12:56:20 +01:00
Klaas van Schelven
d5228f9932 Add 'level' to logentry event details 2025-02-27 15:26:10 +01:00
Klaas van Schelven
7a19e2d277 Tags; deducing tags; search on tags; WIP 2025-02-27 13:12:49 +01:00
Klaas van Schelven
4b7ed8f4ec Rename get_contexts_enriched_with_ua
more closely match what's going on
2025-02-26 18:20:52 +01:00
Klaas van Schelven
2cb87f8334 Issues list pagination 2025-02-18 09:47:30 +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
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
615d2da4c8 Chache stored_event_count (on Issue and Projet)
"possibly expensive" turned out to be "actually expensive". On 'emu', with 1.5M
events, the counts take 85 and 154 ms for Project and Issue respectively;
bottlenecking our digestion to ~3 events/s.

Note: this is single-issue, single-project (presumably, the cost would be lower
for more spread-out cases)

Note on indexes: Event already has indexes for both Project & Issue (though as
the first item in a multi-column index). Without checking further: that appears
to not "magically solve counting".

This commit also optimizes the .count() on the issue-detail event list (via
Paginator).

This commit also slightly changes the value passed as `stored_event_count` to
be used for `get_random_irrelevance` to be the post-evication value. That won't
matter much in practice, but is slightly more correct IMHO.
2025-02-06 16:24:25 +01:00
Klaas van Schelven
86e8c4318b Add indexes on fields on which we order and vice versa
Triggered by issue_event_list being more than 5s on "emu" (my 1,500,000 event
test-machine). Reason: sorting those events on non-indexed field. Switching
to a field-with-index solved it.

I then analysed (grepped) for "ordering" and "order_by" and set indexes
accordingly and more or less indiscriminately (i.e. even on tables that are
assumed to have relatively few rows, such as Project & Team).
2025-02-04 21:19:24 +01:00
Klaas van Schelven
3dec96509b Show event.grouping.grouping_key in the event details UI 2025-01-31 16:16:47 +01:00
Klaas van Schelven
102070bf24 Show transaction in the event details 2025-01-31 13:09:54 +01:00
Klaas van Schelven
d2f4be193f Comment about logentry.* in the event details 2025-01-31 13:03:13 +01:00
Klaas van Schelven
b57ccec4c6 Show 'handled' and 'mechanism' in the event details 2025-01-31 13:02:49 +01:00
Klaas van Schelven
a5bc27032a Visualize trimmed data ('x items trimmed')
Fix #18

Similar to [the request for the same feature in Sentry](https://github.com/getsentry/sentry/issues/68426)

SDK-side complaints:

* https://github.com/getsentry/sentry-python/issues/377
* https://github.com/getsentry/sentry-python/issues/805
* https://github.com/getsentry/sentry-python/issues/1041
* https://github.com/getsentry/sentry-python/issues/1105
* https://github.com/getsentry/sentry-python/issues/2121
* https://github.com/getsentry/sentry-python/issues/2682
* https://github.com/getsentry/sentry-python/issues/3209
* https://github.com/getsentry/sentry-python/issues/3634
* https://github.com/getsentry/sentry-python/issues/3740
2024-12-18 17:05:26 +01:00
Klaas van Schelven
c1a74542f2 Breadcrumbs can be w/o values too (see 2 prev. commits) 2024-12-16 11:24:20 +01:00
Klaas van Schelven
b597d91af7 Become robust for lack of .values key in exception
Fix #16
2024-12-16 11:22:32 +01:00
Klaas van Schelven
a899be8cd5 Order events on event_list page
Paginator's Warning inspired me to do so
2024-09-26 16:18:29 +02:00
Klaas van Schelven
336e126e3e Event-list: pagination 2024-09-26 10:39:36 +02:00
Klaas van Schelven
fd79706c54 Search (TSTTCPW approach) 2024-09-25 14:49:05 +02:00
Klaas van Schelven
278630b529 Show Browser and OS info, and Contexts more generally 2024-09-16 16:55:34 +02:00
Klaas van Schelven
d6c61c25bb When resolving, show history as 'resolved' (bugfix) 2024-08-19 11:43:14 +02:00
Klaas van Schelven
b76e474ef1 Navigation: fix for missing events
Now that we have eviction, events may disappear. Deal with it:

* event-specific 404 that still allows for navigation
* first/last buttons
* navigation to prev/next when prev/next is not just 1 step away
* don't use HttpRedirect for "lookup based" views
    in principle, the thing you were looking for might go missing in-between
    drawback: these URLs are not "stable"
2024-07-19 11:03:08 +02:00
Klaas van Schelven
3128392d9a Distinguish ingested_at and digested_at 2024-07-18 14:45:59 +02:00
Klaas van Schelven
c01d332e18 Rename ingest_order to digest_order and clarify event_count
* issue.event_count to digested_event_count
* event.ingest_order to event.digest_order
* issue.ingest_order to digest_order

This is generally more correct/explicit, and is also in preparation
of doing work on-digest (which may or may not happen)
2024-07-16 15:23:40 +02:00
Klaas van Schelven
5ce840f62f Move period_utils to separate file 2024-07-15 14:38:35 +02:00
Klaas van Schelven
2d7a261515 Project-settings buttons at bottom of issue-list 2024-06-17 12:37:24 +02:00
Klaas van Schelven
8d23239526 Be more strict about usage of TransactionTestCase in tests 2024-04-27 20:35:35 +02:00
Klaas van Schelven
8e70d04c2c Split issue_list into 2 parts for a shorter write-lock 2024-04-19 09:16:18 +02:00
Klaas van Schelven
c50780ab4e Use atomic transactions in views 2024-04-18 13:15:46 +02:00
Klaas van Schelven
f236dea0bf Don't allow newly created empty comments 2024-04-15 19:47:30 +02:00
Klaas van Schelven
308a257d3f Implement comment-deleting 2024-04-15 16:02:03 +02:00
Klaas van Schelven
d3e73a5c87 Permission-check on comment-editing 2024-04-15 15:12:43 +02:00
Klaas van Schelven
8db44bbb6d Fix ResponseNotAllowed usage
not sure if this is 'a keeper' but let's at least use the right syntax
2024-04-15 15:10:21 +02:00
Klaas van Schelven
17ace382dc History: anchors for comments 2024-04-15 13:53:34 +02:00
Klaas van Schelven
6b23b03a82 History: edit (and fixes) 2024-04-15 13:44:14 +02:00
Klaas van Schelven
26aac0ca2c Manual annotations: create 'm
and some non-completed code for editing
2024-04-15 12:58:50 +02:00
Klaas van Schelven
dcd154f74d History: link to triggering event when it is available 2024-04-15 10:46:23 +02:00
Klaas van Schelven
280bd2172b History page: 'mostly done' (a first setup) 2024-04-12 16:07:25 +02:00
Klaas van Schelven
a9557201b1 Fix _is_valid_action 'typo' 2024-04-12 11:34:12 +02:00