Issue Tag display: for low event-counts, show more tags

and for high event-counts, display a warning about what is hidden
This commit is contained in:
Klaas van Schelven
2025-03-31 09:56:31 +02:00
parent 2d51426618
commit 524f5ea45e
3 changed files with 15 additions and 4 deletions

View File

@@ -127,9 +127,14 @@ class Issue(models.Model):
def _get_issue_tags(self, other_cutoff, other_label):
result = []
ds = self.tags \
.filter(key__mostly_unique=False)\
.values("key")\
if self.digested_event_count > other_cutoff:
base_qs = self.tags.filter(key__mostly_unique=False)
else:
# for low-event-count issues, we just show all tags and their values; we _can_ just do it because there's
# not too many, and it's actually useful (and maybe even what you expect).
base_qs = self.tags
ds = base_qs.values("key")\
.annotate(count_sum=models.Sum("count"))\
.distinct()\
.order_by("key__key")

View File

@@ -25,4 +25,10 @@
{% endfor %}
{% if issue.digested_event_count > 25 %}
<div class="mt-4 italic">
Note: Tags which have values that are mostly unique per event (such as <span class="not-italic">trace, user, browser version and os version</span>) are not displayed here.
</div>
{% endif %}
{% endblock %}

File diff suppressed because one or more lines are too long