-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(python): Illustrate types of metrics #15556
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
Changes from 4 commits
9e2cb1b
528fbbb
eed0809
a2d4b46
f0f2e30
3e181d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,26 +2,62 @@ Once the feature is enabled on the SDK and the SDK is initialized, you can send | |||||||||
|
|
||||||||||
| The `metrics` namespace exposes three methods that you can use to capture different types of metric information: `count`, `gauge`, and `distribution`. | ||||||||||
|
|
||||||||||
| ## Emit a Counter | ||||||||||
|
|
||||||||||
| Counters are one of the more basic types of metrics and can be used to count certain event occurrences. | ||||||||||
|
|
||||||||||
| To emit a counter, do the following: | ||||||||||
|
|
||||||||||
| ```python | ||||||||||
| from sentry_sdk import metrics | ||||||||||
| import sentry_sdk | ||||||||||
|
|
||||||||||
| metrics.count("checkout.failed", 1) | ||||||||||
| metrics.gauge("queue.depth", 42) | ||||||||||
| metrics.distribution("cart.amount_usd", 187.5) | ||||||||||
| # Record five total button clicks | ||||||||||
| sentry_sdk.metrics.count( | ||||||||||
| name="button_click", | ||||||||||
| value=5, | ||||||||||
|
||||||||||
| name="button_click", | |
| value=5, | |
| "button_click", | |
| 5, |
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.
agreed and changed, these were artifacts of the old metrics docs I copied the examples from.
Outdated
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.
| name="page_load", | |
| value=15.0, | |
| "page_load", | |
| 15.0, |
Outdated
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.
| name="page_load", | |
| value=15.0, | |
| "page_load", | |
| 15.0, |
Uh oh!
There was an error while loading. Please reload this page.