Add metrics for users per community and user activity recency#8650
Merged
Conversation
Adds two new Prometheus metrics: - couchers_users_per_community: number of users per community, labeled by community name, for communities at the region level and broader - couchers_active_users_by_recency: number of users bucketed by how recently they were last active (<1d, 1d-1w, 1w-1m, 1m-6m, 6m-12m, 12m-24m, 24m+) Co-authored-by: Aapeli <aapeliv@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The test_metrics.py autouse fixture only depended on testconfig, not the db fixture, so users accumulated across runs and made the active users recency gauge test non-deterministic. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The metrics tests didn't request the db fixture, so tables were never truncated and users accumulated across runs, making the active users recency gauge test non-deterministic. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ity metric Read the per-community user count from the cluster_subscription_counts materialized view instead of joining ClusterSubscription/User live on every scrape. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
📝 Release NotesThis PR does not need to be included in release notes. Reason: This PR only adds internal Prometheus monitoring metrics for communities and user activity recency. It does not introduce any user-facing feature, noticeable UX change, important bug fix, safety feature, or major infrastructure improvement that end users would notice. 🤖 Bot Debug InformationModel: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two new Prometheus metrics:
Describe briefly what this PR is doing and why.
Testing
Explain how you tested this PR and give clear steps so the reviewer can replicate.
Backend checklist
developif necessary for linear migration historyWeb frontend checklist
For maintainers