plainx-sentry 0.5.2__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/PKG-INFO +2 -2
- plainx_sentry-0.7.0/plainx/sentry/CHANGELOG.md +11 -0
- plainx_sentry-0.7.0/plainx/sentry/__init__.py +0 -0
- plainx_sentry-0.7.0/plainx/sentry/config.py +38 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/plainx/sentry/templates.py +3 -3
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/pyproject.toml +5 -2
- plainx_sentry-0.7.0/uv.lock +605 -0
- plainx_sentry-0.5.2/plainx/sentry/__init__.py +0 -3
- plainx_sentry-0.5.2/plainx/sentry/config.py +0 -20
- plainx_sentry-0.5.2/plainx/sentry/middleware.py +0 -154
- plainx_sentry-0.5.2/uv.lock +0 -257
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/.gitignore +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/README.md +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/plainx/sentry/default_settings.py +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/plainx/sentry/templates/sentry/js.html +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/scripts/install +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/scripts/release +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/scripts/test +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/tests/settings.py +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/tests/templates/index.html +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/tests/test_sentry.py +0 -0
- {plainx_sentry-0.5.2 → plainx_sentry-0.7.0}/tests/urls.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plainx-sentry
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Author-email: Dave Gaeddert <dave.gaeddert@gmail.com>
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: sentry-sdk>=2.24.0
|
|
6
|
+
Requires-Dist: sentry-sdk[opentelemetry]>=2.24.0
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
|
|
9
9
|
# plainx-sentry
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# plainx-sentry changelog
|
|
2
|
+
|
|
3
|
+
## [0.7.0](https://github.com/davegaeddert/plainx-sentry/releases/plainx-sentry@0.7.0) (2025-07-19)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Middleware was removed in favor of using the OpenTelemetry integration and new otel instrumentation in Plain.
|
|
8
|
+
|
|
9
|
+
### Upgrade instructions
|
|
10
|
+
|
|
11
|
+
- Remove `SentryMiddleware` and `SentryWorkerMiddleware` from your `app/settings.py`.
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import sentry_sdk
|
|
2
|
+
from opentelemetry import trace
|
|
3
|
+
from opentelemetry.propagate import set_global_textmap
|
|
4
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
5
|
+
from plain.packages import PackageConfig, register_config
|
|
6
|
+
from plain.runtime import settings
|
|
7
|
+
from sentry_sdk.integrations.opentelemetry import SentryPropagator, SentrySpanProcessor
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@register_config
|
|
11
|
+
class PlainxSentryConfig(PackageConfig):
|
|
12
|
+
label = "plainxsentry"
|
|
13
|
+
|
|
14
|
+
def ready(self):
|
|
15
|
+
if settings.SENTRY_DSN and settings.SENTRY_AUTO_INIT:
|
|
16
|
+
sentry_sdk.init(
|
|
17
|
+
settings.SENTRY_DSN,
|
|
18
|
+
release=settings.SENTRY_RELEASE,
|
|
19
|
+
environment=settings.SENTRY_ENVIRONMENT,
|
|
20
|
+
send_default_pii=settings.SENTRY_PII_ENABLED,
|
|
21
|
+
traces_sample_rate=settings.SENTRY_TRACES_SAMPLE_RATE,
|
|
22
|
+
profiles_sample_rate=settings.SENTRY_PROFILES_SAMPLE_RATE,
|
|
23
|
+
instrumenter="otel",
|
|
24
|
+
**settings.SENTRY_INIT_KWARGS,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# Set up OpenTelemetry tracing with Sentry
|
|
28
|
+
if trace.get_tracer_provider() and not isinstance(
|
|
29
|
+
trace.get_tracer_provider(), trace.ProxyTracerProvider
|
|
30
|
+
):
|
|
31
|
+
raise RuntimeError(
|
|
32
|
+
"A tracer provider already exists. Sentry's OpenTelemetry integration requires a clean tracer provider."
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
provider = TracerProvider()
|
|
36
|
+
provider.add_span_processor(SentrySpanProcessor())
|
|
37
|
+
trace.set_tracer_provider(provider)
|
|
38
|
+
set_global_textmap(SentryPropagator())
|
|
@@ -35,9 +35,9 @@ class SentryJSExtension(InclusionTagExtension):
|
|
|
35
35
|
sentry_context["sentry_init"]["initialScope"] = {"user": {"id": user.id}}
|
|
36
36
|
if settings.SENTRY_PII_ENABLED:
|
|
37
37
|
if email := getattr(user, "email", None):
|
|
38
|
-
sentry_context["sentry_init"]["initialScope"]["user"][
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
sentry_context["sentry_init"]["initialScope"]["user"]["email"] = (
|
|
39
|
+
email
|
|
40
|
+
)
|
|
41
41
|
if username := getattr(user, "username", None):
|
|
42
42
|
sentry_context["sentry_init"]["initialScope"]["user"][
|
|
43
43
|
"username"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "plainx-sentry"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.7.0"
|
|
4
4
|
description = ""
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -8,7 +8,7 @@ authors = [
|
|
|
8
8
|
]
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"sentry-sdk>=2.24.0",
|
|
11
|
+
"sentry-sdk[opentelemetry]>=2.24.0",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
[dependency-groups]
|
|
@@ -22,6 +22,9 @@ dev = [
|
|
|
22
22
|
[tool.hatch.build.targets.wheel]
|
|
23
23
|
packages = ["plainx"]
|
|
24
24
|
|
|
25
|
+
|
|
26
|
+
[tool.plain.code.biome]
|
|
27
|
+
version = "2.1.2"
|
|
25
28
|
[build-system]
|
|
26
29
|
requires = ["hatchling"]
|
|
27
30
|
build-backend = "hatchling.build"
|