Skip to content

Commit 2438b78

Browse files
.
1 parent 48dc13f commit 2438b78

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The 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" />

platform-includes/metrics/options/python.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
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
66
import sentry_sdk
77
from sentry_sdk.types import Metric, Hint
88
from typing import Optional
99

1010
def 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

1617
sentry_sdk.init(
1718
dsn="___PUBLIC_DSN___",

0 commit comments

Comments
 (0)