-
-
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(events tracking): add abstract class and logging implementation #80117
base: master
Are you sure you want to change the base?
Conversation
src/sentry/utils/event_tracker.py
Outdated
START = "start" | ||
END = "end" |
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.
Consider making the enum an integer. That would take a lot less memory in redis.
The galaxy brain version would be to create a bitmap. One bit per phase. Each event only needs 12 bits to encode all phases. https://redis.io/docs/latest/develop/data-types/bitmaps/
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.
not writing to redis with the logging implementation but i get the idea
a147a53
to
c09a7c4
Compare
2ebf8d5
to
8b5234b
Compare
src/sentry/utils/event_tracker.py
Outdated
""" | ||
Records how far an event has made it through the ingestion pipeline. | ||
""" | ||
self.logger.info(f"EventTracker recorded event {event_id} - {status.value}") |
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.
if you are building log analysis tools on top of this structured logging might make life easier
9d4217c
to
3143ea2
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
cbe0288
to
e6aea02
Compare
src/sentry/utils/event_tracker.py
Outdated
Records how far an event has made it through the ingestion pipeline. | ||
""" | ||
if is_tracked: | ||
extra = {"event_id": event_id, "status": status} |
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.
You need to do EventStageStatus.value
to get the string value from the enum.
Alternatively you can use StrEnum
which is probably a better approach
50fd62e
to
ec9a363
Compare
45b1ace
to
d01bd37
Compare
1ae973e
to
6f13c83
Compare
f3b240f
to
024fe35
Compare
design doc
need to track the completion of each stage, to 1) compute events conversion rates 2) enable debugging visibility into where events are being dropped
the usage will be heavily sampled to not blow up traffic