File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
platform-includes/metrics Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 11The Python SDK automatically sets several default attributes on all metrics to provide context and improve debugging:
22
3- <Include name = " logs /default-attributes/core" />
3+ <Include name = " metrics /default-attributes/core" />
44
5- <Include name = " logs /default-attributes/server" />
5+ <Include name = " metrics /default-attributes/server" />
66
7- <Include name = " logs /default-attributes/user" />
7+ <Include name = " metrics /default-attributes/user" />
Original file line number Diff line number Diff line change 11#### before_send_log
22
3- To filter logs , or update them before they are sent to Sentry, you can use the ` before_send_metric ` option.
3+ To filter metrics , or update them before they are sent to Sentry, you can use the ` before_send_metric ` option.
44
55``` python
66import sentry_sdk
77from sentry_sdk.types import Metric, Hint
88from typing import Optional
99
1010def before_metric (metric : Metric, _hint : Hint) -> Optional[Metric]:
11- # Filter out all info level logs
12- if log[ " severity_text " ] == " info " :
11+ # Filter out all metrics with a certain name
12+ if record[ " name " ] == " test.skip " :
1313 return None
14- return log
14+
15+ return metric
1516
1617sentry_sdk.init(
1718 dsn = " ___PUBLIC_DSN___" ,
You can’t perform that action at this time.
0 commit comments