Skip to content

fix: split rating feedback tags by thumbsUp/thumbsDown direction#65

Merged
Odrec merged 1 commit into
mainfrom
fix/rating-tags-rating-label
May 29, 2026
Merged

fix: split rating feedback tags by thumbsUp/thumbsDown direction#65
Odrec merged 1 commit into
mainfrom
fix/rating-tags-rating-label

Conversation

@Odrec
Copy link
Copy Markdown
Collaborator

@Odrec Odrec commented May 29, 2026

Closes #64.

Problem

The rating tags were out of sync with positive/negative feedback. LibreChat stores feedback as { rating, tag }, and each feedback tag belongs to exactly one rating direction (verified against production: accurate_reliable→thumbsUp, not_matched→thumbsDown, etc.). But the per-tag metric grouped on feedback.tag alone, discarding the rating direction — so in Grafana there was no way to separate positive from negative feedback tags.

The README also documented tags (helpful, creative, unhelpful) that no longer exist in current LibreChat.

Changes

  • metrics.py: Query 3 now groups by {tag, rating}, and librechat_rating_counts_per_tag gains a rating="thumbsUp|thumbsDown" label.
  • README.md: example metrics updated to the real current LibreChat tag keys and the new rating label.
  • prometheus-dev/Grafana-Dashboard-template.json: added "Positive Feedback Tags" and "Negative Feedback Tags" panels using the new label; shifted the Tools & Files row to make room.

Compatibility note

This adds a label to an existing metric. Queries on librechat_rating_counts_per_tag{tag="..."} keep working, but recording rules/alerts that assumed no rating label will now see series split by rating direction.

Verification

  • Confirmed the real {tag, rating} distribution and that feedback.tag is a plain string key against the production LibreChat MongoDB.
  • Metric renders correct Prometheus exposition format with the real data.
  • Dashboard JSON validated; metrics.py compiles and passes flake8 F/E9 checks.

The per-tag rating metric grouped on feedback.tag alone, dropping the
rating direction. Since each LibreChat feedback tag belongs to exactly
one rating (thumbsUp/thumbsDown), positive and negative tags could not
be told apart in Grafana.

- Group Query 3 by {tag, rating} and add a `rating` label to
  librechat_rating_counts_per_tag.
- Update README examples to the current LibreChat tag keys and the new
  label (drops stale 'helpful'/'creative'/'unhelpful' tags).
- Add Positive/Negative Feedback Tags panels to the Grafana template.

Closes #64
@Odrec Odrec merged commit 2d48b9d into main May 29, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rating tags are out of date

1 participant