-
Notifications
You must be signed in to change notification settings - Fork 11
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
delete MetricContext, populate sentry tags from LogContext #818
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #818 +/- ##
=======================================
Coverage 98.02% 98.03%
=======================================
Files 442 442
Lines 36163 36113 -50
=======================================
- Hits 35448 35402 -46
+ Misses 715 711 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #818 +/- ##
=======================================
Coverage 98.02% 98.03%
=======================================
Files 442 442
Lines 36163 36113 -50
=======================================
- Hits 35448 35402 -46
+ Misses 715 711 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #818 +/- ##
=======================================
Coverage 98.02% 98.03%
=======================================
Files 442 442
Lines 36163 36113 -50
=======================================
- Hits 35448 35402 -46
+ Misses 715 711 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #818 +/- ##
=======================================
Coverage 98.02% 98.03%
=======================================
Files 442 442
Lines 36163 36113 -50
=======================================
- Hits 35448 35402 -46
+ Misses 715 711 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
def add_to_sentry(self): | ||
d = self.as_dict() | ||
d.pop("sentry_trace_id", None) | ||
sentry_sdk.set_tags(d) |
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.
Interesting, I see set_tags
as a Scope
API, but not as part of the top level APIs.
Maybe this is just an oversight in the docs? CC @antonpirker
`log_simple_metric()`, meaning it will throw logging on the | ||
asyncio queue and then immediately return without needing to be awaited. Can |
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.
as this is now using a ContextVar
, is that guaranteed to be more consistent than a global which might change underneath?
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.
y'know, good question. i think so; as i understand it the context will inherit a clone of the parent context so the parent context is free to change
MetricContext
, cleans up usage of SQL metricsmetric_context.populate()
db queries although there were not manyLogContext
fields to sentry tagsLogContext
the decider of how its fields are added to log records and sentry tagstask_id
andtask_name
log fields