-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat(escalating-v2): Emit escalating metrics #52774
Conversation
org_id=event.project.organization_id, | ||
project_id=event.project.id, | ||
metric_name="event_ingested", | ||
value=1, |
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.
@ayirr7 this should get aggregated as part of the counter right?
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.
yes, that's correct
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #52774 +/- ##
==========================================
+ Coverage 79.48% 79.50% +0.02%
==========================================
Files 4935 4940 +5
Lines 207668 208164 +496
Branches 35453 35507 +54
==========================================
+ Hits 165069 165505 +436
- Misses 37570 37621 +51
- Partials 5029 5038 +9
|
metric_name="event_ingested", | ||
value=1, | ||
tags={"group": event.group_id}, | ||
unit=None, |
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.
what is unit
?
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.
it's the mri_unit in this template ":/@". I've mostly seen units of time (millisecond, second) here
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.
@ayirr7 what should this be set to for our needs?
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.
The unit for the metric you are emitting (whatever you are measuring). If there is no unit then None
is fine
src/sentry/tasks/post_process.py
Outdated
project_id=event.project.id, | ||
metric_name="event_ingested", | ||
value=1, | ||
tags={"group": event.group_id}, |
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.
Is event.group_id
a string?
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.
Tag keys and values must both be strings to be compatible with the Kafka schema here https://github.com/getsentry/sentry-kafka-schemas/blob/main/schemas/ingest-metrics.v1.schema.json
PR reverted: 89889c3 |
This reverts commit 11e749f. Co-authored-by: beezz <[email protected]>
@@ -16,6 +16,8 @@ | |||
from sentry.issues.grouptype import GroupCategory | |||
from sentry.issues.issue_occurrence import IssueOccurrence | |||
from sentry.killswitches import killswitch_matches_context | |||
from sentry.sentry_metrics.kafka import KafkaMetricsBackend |
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.
@ayirr7 I think we should hide which backend gets used from the caller.
it should be something like
from sentry.sentry_metrics import get_sentry_metrics_backend
# today this returns a KafkaMetricsBackend, but later it
# should be configurable from somewhere outside the importing file
metrics_backend = get_sentry_metrics_backend()
This also makes it easier to only have one connection (pool) per process
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.
Sentry has the service delegator / LazyServiceWrapper abstraction which is commonly used for this
Update the ESCALATING_ISSUES use case during post_process as we see new events come in.