Skip to content

Commit

Permalink
Merge branch 'master' into antonpirker/django-fix-asgihandler-import
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker authored Jun 18, 2024
2 parents 4b5cfba + c8fc781 commit e5f590a
Show file tree
Hide file tree
Showing 45 changed files with 1,405 additions and 510 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand All @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand All @@ -54,7 +54,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/[email protected].5
uses: actions/[email protected].6

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-aws-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
name: permissions check
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected].4
- uses: actions/[email protected].6
with:
persist-credentials: false
- name: Check permissions on PR
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
os: [ubuntu-20.04]
needs: check-permissions
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-cloud-computing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-data-processing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-miscellaneous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-networking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-web-frameworks-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-web-frameworks-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 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
Expand Down
2 changes: 1 addition & 1 deletion checkouts/data-schemas
2 changes: 1 addition & 1 deletion docs/apidocs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ API Docs
.. autoclass:: sentry_sdk.tracing.Span
:members:

.. autoclass:: sentry_sdk.profiler.Profile
.. autoclass:: sentry_sdk.profiler.transaction_profiler.Profile
:members:

.. autoclass:: sentry_sdk.session.Session
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
author = "Sentry Team and Contributors"

release = "2.5.0"
release = "2.5.1"
version = ".".join(release.split(".")[:2]) # The short X.Y version.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: permissions check
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected].4
- uses: actions/[email protected].6
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion scripts/split-tox-gh-actions/templates/test_group.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{% endif %}

steps:
- uses: actions/[email protected].5
- uses: actions/[email protected].6
{% if needs_github_secrets %}
{% raw %}
with:
Expand Down
14 changes: 4 additions & 10 deletions sentry_sdk/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Mapping
from typing import NotRequired
from typing import Optional
Expand Down Expand Up @@ -153,12 +152,14 @@
"session",
"internal",
"profile",
"profile_chunk",
"metric_bucket",
"monitor",
]
SessionStatus = Literal["ok", "exited", "crashed", "abnormal"]

ProfilerMode = Literal["sleep", "thread", "gevent", "unknown"]
ContinuousProfilerMode = Literal["thread", "gevent", "unknown"]
ProfilerMode = Union[ContinuousProfilerMode, Literal["sleep"]]

# Type of the metric.
MetricType = Literal["d", "s", "g", "c"]
Expand All @@ -171,14 +172,7 @@
MetricTagsInternal = Tuple[Tuple[str, str], ...]

# External representation of tags as a dictionary.
MetricTagValue = Union[
str,
int,
float,
None,
List[Union[int, str, float, None]],
Tuple[Union[int, str, float, None], ...],
]
MetricTagValue = Union[str, int, float, None]
MetricTags = Mapping[str, MetricTagValue]

# Value inside the generator for the metric value.
Expand Down
15 changes: 14 additions & 1 deletion sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
from sentry_sdk.utils import ContextVar
from sentry_sdk.sessions import SessionFlusher
from sentry_sdk.envelope import Envelope
from sentry_sdk.profiler import has_profiling_enabled, Profile, setup_profiler
from sentry_sdk.profiler.continuous_profiler import setup_continuous_profiler
from sentry_sdk.profiler.transaction_profiler import (
has_profiling_enabled,
Profile,
setup_profiler,
)
from sentry_sdk.scrubber import EventScrubber
from sentry_sdk.monitor import Monitor
from sentry_sdk.spotlight import setup_spotlight
Expand Down Expand Up @@ -378,6 +383,14 @@ def _capture_envelope(envelope):
setup_profiler(self.options)
except Exception as e:
logger.debug("Can not set up profiler. (%s)", e)
else:
try:
setup_continuous_profiler(
self.options,
capture_func=_capture_envelope,
)
except Exception as e:
logger.debug("Can not set up continuous profiler. (%s)", e)

finally:
_client_init_debug.set(old_debug)
Expand Down
16 changes: 15 additions & 1 deletion sentry_sdk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class EndpointType(Enum):

from sentry_sdk._types import (
BreadcrumbProcessor,
ContinuousProfilerMode,
Event,
EventProcessor,
Hint,
Expand All @@ -55,6 +56,8 @@ class EndpointType(Enum):
"attach_explain_plans": dict[str, Any],
"max_spans": Optional[int],
"record_sql_params": Optional[bool],
"continuous_profiling_auto_start": Optional[bool],
"continuous_profiling_mode": Optional[ContinuousProfilerMode],
"otel_powered_performance": Optional[bool],
"transport_zlib_compression_level": Optional[int],
"transport_num_pools": Optional[int],
Expand Down Expand Up @@ -298,6 +301,11 @@ class SPANDATA:
Number of retries/attempts to process a message.
"""

MESSAGING_MESSAGE_RECEIVE_LATENCY = "messaging.message.receive.latency"
"""
The latency between when the task was enqueued and when it was started to be processed.
"""

MESSAGING_SYSTEM = "messaging.system"
"""
The messaging system's name, e.g. `kafka`, `aws_sqs`
Expand Down Expand Up @@ -364,6 +372,12 @@ class SPANDATA:
Example: "MainThread"
"""

PROFILER_ID = "profiler.id"
"""
Label identifying the profiler id that the span occurred in. This should be a string.
Example: "5249fbada8d5416482c2f6e47e337372"
"""


class OP:
ANTHROPIC_MESSAGES_CREATE = "ai.messages.create.anthropic"
Expand Down Expand Up @@ -508,4 +522,4 @@ def _get_default_options():
del _get_default_options


VERSION = "2.5.0"
VERSION = "2.5.1"
Loading

0 comments on commit e5f590a

Please sign in to comment.