-
Notifications
You must be signed in to change notification settings - Fork 29
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 /org/[key]/metrics endpoint #251
Conversation
Codecov Report
@@ Coverage Diff @@
## master #251 +/- ##
==========================================
+ Coverage 48.34% 49.06% +0.72%
==========================================
Files 84 85 +1
Lines 7658 7818 +160
==========================================
+ Hits 3702 3836 +134
- Misses 3374 3387 +13
- Partials 582 595 +13
Continue to review full report at Codecov.
|
web.RegisterRoute(http.MethodGet, "/mr/org/{token:[0-9a-f]+}/metrics", handleMetrics) | ||
} | ||
|
||
const groupCountsSQL = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally this stuff would live in models
instead of web/..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that but it is pretty specific to metrics. Everything in models..
deals with a bit more concrete stuff. I don't know, just seemed awash either way and having it closer to the point of use felt right since these are highly optimized for this use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(could I guess obfuscate with rp_
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh, in the end I think just being clear here is best.
defer rows.Close() | ||
|
||
family := &dto.MetricFamily{ | ||
Name: proto.String("rapidpro_group_contact_count"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temba? in case textit users want this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So was thinking of using temba_
for the internal metrics (things like courier queue size for example). rapidpro_
instead being "org" level stuff.
We don't need to hide that TextIt is RapidPro I don't think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok that works 👍
Use std library errors
Adds prometheus endpoint for contact group counts and channel counts.