Skip to content

Commit

Permalink
Merge pull request #1720 from emfcamp/metric-checked-in-purchase
Browse files Browse the repository at this point in the history
Add a more generic checked-in-purchase metric
  • Loading branch information
lukegb authored Jun 2, 2024
2 parents aeb4418 + 50d321a commit aac5a58
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit aac5a58

Please sign in to comment.