Skip to content

Commit cd2f268

Browse files
committed
Merge branch 'master' into feat/span-first
2 parents 81b8b42 + 181626b commit cd2f268

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ This is an alpha release for internal testing.
1010

1111
- Add `set_attribute`, `remove_attribute` to global API by @sentrivana in [#5555](https://github.com/getsentry/sentry-python/pull/5555)
1212

13+
You can now set and unset attributes on logs and metrics via top-level API. Think of it as `sentry_sdk.set_tag()` for attribute-based telemetry. Other event types (transactions, spans, errors) will be unaffected.
14+
15+
```python
16+
import sentry_sdk
17+
18+
sentry_sdk.init(...)
19+
20+
sentry_sdk.set_attribute("my.attribute", "my value")
21+
22+
# This metric will have "my.attribute" set
23+
sentry_sdk.metrics.count("counter", 1)
24+
25+
# Remove the attribute
26+
sentry_sdk.remove_attribute("my.attribute")
27+
28+
# This log will not have "my.attribute" set
29+
sentry_sdk.logger.info("An info log")
30+
```
31+
1332
### Bug Fixes 🐛
1433

1534
#### Openai

0 commit comments

Comments
 (0)