Releases: getsentry/sentry-python
2.10.0
Various fixes & improvements
-
Add client cert and key support to
HttpTransport
(#3258) by @grammy-jiangAdd
cert_file
andkey_file
to yoursentry_sdk.init
to use a custom client cert and key. Alternatively, the environment variablesCLIENT_CERT_FILE
andCLIENT_KEY_FILE
can be used as well. -
OpenAI: Lazy initialize tiktoken to avoid http at import time (#3287) by @colin-sentry
-
OpenAI, Langchain: Make tiktoken encoding name configurable + tiktoken usage opt-in (#3289) by @colin-sentry
Fixed a bug where having certain packages installed along the Sentry SDK caused an HTTP request to be made to OpenAI infrastructure when the Sentry SDK was initialized. The request was made when the
tiktoken
package and at least one of theopenai
orlangchain
packages were installed.The request was fetching a
tiktoken
encoding in order to correctly measure token usage in some OpenAI and Langchain calls. This behavior is now opt-in. The choice of encoding to use was made configurable as well. To opt in, set thetiktoken_encoding_name
parameter in the OpenAPI or Langchain integration.sentry_sdk.init( integrations=[ OpenAIIntegration(tiktoken_encoding_name="cl100k_base"), LangchainIntegration(tiktoken_encoding_name="cl100k_base"), ], )
-
PyMongo: Send query description as valid JSON (#3291) by @0Calories
-
Remove Python 2 compatibility code (#3284) by @szokeasaurusrex
-
Fix
sentry_sdk.init
type hint (#3283) by @szokeasaurusrex -
Deprecate
hub
inProfile
(#3270) by @szokeasaurusrex -
Stop using
Hub
ininit
(#3275) by @szokeasaurusrex -
Delete
_should_send_default_pii
(#3274) by @szokeasaurusrex -
Remove
Hub
usage inconftest
(#3273) by @szokeasaurusrex -
Rename debug logging filter (#3260) by @szokeasaurusrex
-
Update
NoOpSpan.finish
signature (#3267) by @szokeasaurusrex -
Remove
Hub
inTransaction.finish
(#3267) by @szokeasaurusrex -
Remove Hub from
capture_internal_exception
logic (#3264) by @szokeasaurusrex -
Improve
Scope._capture_internal_exception
type hint (#3264) by @szokeasaurusrex -
Correct
ExcInfo
type (#3266) by @szokeasaurusrex -
Stop using
Hub
intracing_utils
(#3269) by @szokeasaurusrex
2.9.0
Various fixes & improvements
- ref(transport): Improve event data category typing (#3243) by @szokeasaurusrex
- ref(tracing): Improved handling of span status (#3261) by @antonpirker
- test(client): Add tests for dropped span client reports (#3244) by @szokeasaurusrex
- test(transport): Test new client report features (#3244) by @szokeasaurusrex
- feat(tracing): Record lost spans in client reports (#3244) by @szokeasaurusrex
- test(sampling): Replace custom logic with
capture_record_lost_event_calls
(#3257) by @szokeasaurusrex - test(transport): Non-order-dependent discarded events assertion (#3255) by @szokeasaurusrex
- test(core): Introduce
capture_record_lost_event_calls
fixture (#3254) by @szokeasaurusrex - test(core): Fix non-idempotent test (#3253) by @szokeasaurusrex
2.8.0
Various fixes & improvements
profiler_id
uses underscore (#3249) by @Zylphrex- Don't send full env to subprocess (#3251) by @kmichel-aiven
- Stop using
Hub
inHttpTransport
(#3247) by @szokeasaurusrex - Remove
ipdb
from test requirements (#3237) by @rominf - Avoid propagation of empty baggage (#2968) by @hartungstenio
- Add entry point for
SentryPropagator
(#3086) by @mender - Bump checkouts/data-schemas from
8c13457
to88273a9
(#3225) by @dependabot
2.7.1
Various fixes & improvements
- fix(otel): Fix missing baggage (#3218) by @sentrivana
- This is the config file of asdf-vm which we do not use. (#3215) by @antonpirker
- Added option to disable middleware spans in Starlette (#3052) by @antonpirker
- build: Update tornado version in setup.py to match code check. (#3206) by @aclemons
2.7.0
- Add
origin
to spans and transactions (#3133) by @antonpirker - OTel: Set up typing for OTel (#3168) by @sentrivana
- OTel: Auto instrumentation skeleton (#3143) by @sentrivana
- OpenAI: If there is an internal error, still return a value (#3192) by @colin-sentry
- MongoDB: Add MongoDB collection span tag (#3182) by @0Calories
- MongoDB: Change span operation from
db.query
todb
(#3186) by @0Calories - MongoDB: Remove redundant command name in query description (#3189) by @0Calories
- Apache Spark: Fix spark driver integration (#3162) by @seyoon-lim
- Apache Spark: Add Spark test suite to tox.ini and to CI (#3199) by @sentrivana
- Codecov: Add failed test commits in PRs (#3190) by @antonpirker
- Update library, Python versions in tests (#3202) by @sentrivana
- Remove Hub from our test suite (#3197) by @antonpirker
- Use env vars for default CA cert bundle location (#3160) by @DragoonAethis
- Create a separate test group for AI (#3198) by @sentrivana
- Add additional stub packages for type checking (#3122) by @Daverball
- Proper naming of requirements files (#3191) by @antonpirker
- Pinning pip because new version does not work with some versions of Celery and Httpx (#3195) by @antonpirker
- build(deps): bump supercharge/redis-github-action from 1.7.0 to 1.8.0 (#3193) by @dependabot
- build(deps): bump actions/checkout from 4.1.6 to 4.1.7 (#3171) by @dependabot
- build(deps): update pytest-asyncio requirement (#3087) by @dependabot
2.6.0
- Introduce continuous profiling mode (#2830) by @Zylphrex
- Profiling: Add deprecation comment for profiler internals (#3167) by @sentrivana
- Profiling: Move thread data to trace context (#3157) by @Zylphrex
- Explicitly export cron symbols for typecheckers (#3072) by @spladug
- Cleaning up ASGI tests for Django (#3180) by @antonpirker
- Celery: Add Celery receive latency (#3174) by @antonpirker
- Metrics: Update type hints for tag values (#3156) by @elramen
- Django: Fix psycopg3 reconnect error (#3111) by @szokeasaurusrex
- Tracing: Keep original function signature when decorated (#3178) by @sentrivana
- Reapply "Refactor the Celery Beat integration (#3105)" (#3144) (#3175) by @antonpirker
- Added contributor image to readme (#3183) by @antonpirker
- bump actions/checkout from 4.1.4 to 4.1.6 (#3147) by @dependabot
- bump checkouts/data-schemas from
59f9683
to8c13457
(#3146) by @dependabot
2.5.1
This change fixes a regression in our cron monitoring feature, which caused cron checkins not to be sent. The regression appears to have been introduced in version 2.4.0.
We recommend that all users, who use Cron monitoring and are currently running sentry-python ≥2.4.0, upgrade to this release as soon as possible!
Other fixes & improvements
- feat(tracing): Warn if not-started transaction entered (#3003) by @szokeasaurusrex
- test(scope): Ensure
last_event_id
cleared (#3124) by @szokeasaurusrex - fix(scope): Clear last_event_id on scope clear (#3124) by @szokeasaurusrex
2.5.0
Various fixes & improvements
-
Allow to configure status codes to report to Sentry in Starlette and FastAPI (#3008) by @sentrivana
By passing a new option to the FastAPI and Starlette integrations, you're now able to configure what
status codes should be sent as events to Sentry. Here's how it works:from sentry_sdk.integrations.starlette import StarletteIntegration from sentry_sdk.integrations.fastapi import FastApiIntegration sentry_sdk.init( # ... integrations=[ StarletteIntegration( failed_request_status_codes=[403, range(500, 599)], ), FastApiIntegration( failed_request_status_codes=[403, range(500, 599)], ), ] )
failed_request_status_codes
expects a list of integers or containers (objects that allow membership checks viain
)
of integers. Examples of validfailed_request_status_codes
:[500]
will only send events on HTTP 500.[400, range(500, 599)]
will send events on HTTP 400 as well as the 500-599 range.[500, 503]
will send events on HTTP 500 and 503.
The default is
[range(500, 599)]
.See the FastAPI and Starlette integration docs for more details.
-
Support multiple keys with
cache_prefixes
(#3136) by @sentrivana -
Support integer Redis keys (#3132) by @sentrivana
-
Update SDK version in CONTRIBUTING.md (#3129) by @sentrivana
-
Bump actions/checkout from 4.1.4 to 4.1.5 (#3067) by @dependabot
2.4.0
Various fixes & improvements
- Celery: Made
cache.key
span data field a list (#3110) by @antonpirker - Celery Beat: Refactor the Celery Beat integration (#3105) by @antonpirker
- GRPC: Add None check for grpc.aio interceptor (#3109) by @ordinary-jamie
- Docs: Remove
last_event_id
from migration guide (#3126) by @szokeasaurusrex - fix(django): Proper transaction names for i18n routes (#3104) by @sentrivana
- fix(scope): Copy
_last_event_id
inScope.__copy__
(#3123) by @szokeasaurusrex - fix(tests): Adapt to new Anthropic version (#3119) by @sentrivana
- build(deps): bump checkouts/data-schemas from
4381a97
to59f9683
(#3066) by @dependabot
2.3.1
Various fixes & improvements
- Handle also byte arras as strings in Redis caches (#3101) by @antonpirker
- Do not crash exceptiongroup (by patching excepthook and keeping the name of the function) (#3099) by @antonpirker