Commit 3d06bca
Merge master into 2.0 branch (#2805)
* ref: Improve scrub_dict typing (#2768)
This change improves the typing of the scrub_dict method.
Previously, the scrub_dict method's type hints indicated that only dict[str, Any] was accepted as the parameter. However, the method is actually implemented to accept any object, since it checks the types of the parameters at runtime. Therefore, object is a more appropriate type hint for the parameter.
#2753 depends on this change for mypy to pass
* Propagate sentry-trace and baggage to huey tasks (#2792)
This PR enables passing `sentry-trace` and `baggage` headers to background tasks using the Huey task queue.
This allows easily correlating what happens inside a background task with whatever transaction (e.g. a user request in a Django application) queued the task in the first place.
Periodic tasks do not get these headers, because otherwise each execution of the periodic task would be tied to the same parent trace (the long-running worker process).
---
Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
* OpenAI integration (#2791)
* OpenAI integration
* Fix linting errors
* Fix CI
* Fix lint
* Fix more CI issues
* Run tests on version pinned OpenAI too
* Fix pydantic issue in test
* Import type in TYPE_CHECKING gate
* PR feedback fixes
* Fix tiktoken test variant
* PII gate the request and response
* Rename set_data tags
* Move doc location
* Add "exclude prompts" flag as optional
* Change prompts to be excluded by default
* Set flag in tests
* Fix tiktoken tox.ini extra dash
* Change strip PII semantics
* More test coverage for PII
* notiktoken
---------
Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
* Add a method for normalizing data passed to set_data (#2800)
* Discard open spans after 10 minutes (#2801)
OTel spans that are handled in the Sentry span processor can never be finished/closed. This leads to a memory leak. This change makes sure that open spans will be removed from memory after 10 minutes to prevent memory usage from growing constantly.
Fixes #2722
---------
Co-authored-by: Daniel Szoke <szokeasaurusrex@users.noreply.github.com>
* ref: Event Type (#2753)
Implements type hinting for Event via a TypedDict. This commit mainly adjusts type hints; however, there are also some minor code changes to make the code type-safe following the new changes.
Some items in the Event could have their types expanded by being defined as TypedDicts themselves. These items have been indicated with TODO comments.
Fixes GH-2357
* Fix mypy in `client.py`
* Fix functools import
* Fix CI config problem
... by running `python scripts/split-tox-gh-actions/split-tox-gh-actions.py`
---------
Co-authored-by: Christian Schneider <christian@cnschn.com>
Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
Co-authored-by: colin-sentry <161344340+colin-sentry@users.noreply.github.com>1 parent 412ca67 commit 3d06bca
File tree
48 files changed
+932
-116
lines changed- .github/workflows
- scripts/split-tox-gh-actions
- sentry_sdk
- crons
- integrations
- django
- opentelemetry
- spark
- tests/integrations
- huey
- openai
- opentelemetry
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+932
-116
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
23 | 84 | | |
24 | 85 | | |
25 | 86 | | |
26 | 87 | | |
27 | 88 | | |
28 | | - | |
29 | 89 | | |
30 | 90 | | |
31 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
260 | | - | |
| 261 | + | |
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
| |||
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | | - | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
460 | 465 | | |
461 | 466 | | |
462 | 467 | | |
463 | | - | |
| 468 | + | |
464 | 469 | | |
465 | 470 | | |
466 | 471 | | |
| |||
634 | 639 | | |
635 | 640 | | |
636 | 641 | | |
637 | | - | |
| 642 | + | |
638 | 643 | | |
639 | 644 | | |
640 | 645 | | |
641 | 646 | | |
642 | 647 | | |
643 | 648 | | |
644 | 649 | | |
645 | | - | |
| 650 | + | |
| 651 | + | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
| |||
714 | 720 | | |
715 | 721 | | |
716 | 722 | | |
717 | | - | |
| 723 | + | |
718 | 724 | | |
719 | 725 | | |
720 | 726 | | |
721 | 727 | | |
722 | 728 | | |
723 | 729 | | |
724 | 730 | | |
725 | | - | |
| 731 | + | |
726 | 732 | | |
727 | 733 | | |
728 | 734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
350 | | - | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
0 commit comments