Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a more generic checked-in-purchase metric #1720

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def collect(self):
emf_purchases = GaugeMetricFamily(
"emf_purchases", "Tickets purchased", labels=["product", "state", "type"]
)
emf_checked_in_purchases = GaugeMetricFamily(
"emf_checked_in_purchases", "Purchases by checkin state", labels=["product", "type", "checked_in"])
emf_payments = GaugeMetricFamily("emf_payments", "Payments received", labels=["provider", "state"])
emf_attendees = GaugeMetricFamily("emf_attendees", "Attendees", labels=["checked_in"])
emf_proposals = GaugeMetricFamily("emf_proposals", "CfP Submissions", labels=["type", "state"])
Expand All @@ -60,6 +62,13 @@ def collect(self):
Purchase.state,
Purchase.type,
)
gauge_groups(
emf_checked_in_purchases,
Purchase.query.join(Product),
Product.name,
Purchase.type,
cast(Purchase.redeemed, String),
)
gauge_groups(emf_payments, Payment.query, Payment.provider, Payment.state)
gauge_groups(
emf_attendees,
Expand Down Expand Up @@ -133,6 +142,7 @@ def collect(self):

return [
emf_purchases,
emf_checked_in_purchases,
emf_payments,
emf_attendees,
emf_proposals,
Expand Down