plain.observer 0.3.7__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
Potentially problematic release.
This version of plain.observer might be problematic. Click here for more details.
- plain/observer/CHANGELOG.md +21 -0
- plain/observer/admin.py +1 -22
- plain/observer/cli.py +1 -1
- plain/observer/core.py +11 -4
- plain/observer/toolbar.py +22 -0
- {plain_observer-0.3.7.dist-info → plain_observer-0.5.0.dist-info}/METADATA +1 -1
- {plain_observer-0.3.7.dist-info → plain_observer-0.5.0.dist-info}/RECORD +9 -8
- {plain_observer-0.3.7.dist-info → plain_observer-0.5.0.dist-info}/WHEEL +0 -0
- {plain_observer-0.3.7.dist-info → plain_observer-0.5.0.dist-info}/licenses/LICENSE +0 -0
plain/observer/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# plain-observer changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/dropseed/plain/releases/plain-observer@0.5.0) (2025-09-03)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Extended observer summary mode cookie duration from 1 day to 1 week for improved user experience ([bbe8a8a](https://github.com/dropseed/plain/commit/bbe8a8ad54))
|
|
8
|
+
- Changed admin navigation icon for Spans from "diagram-3" to "activity" ([2aac07d](https://github.com/dropseed/plain/commit/2aac07de4e))
|
|
9
|
+
|
|
10
|
+
### Upgrade instructions
|
|
11
|
+
|
|
12
|
+
- No changes required
|
|
13
|
+
|
|
14
|
+
## [0.4.0](https://github.com/dropseed/plain/releases/plain-observer@0.4.0) (2025-08-27)
|
|
15
|
+
|
|
16
|
+
### What's changed
|
|
17
|
+
|
|
18
|
+
- Toolbar functionality has been moved to a new `plain.toolbar` package, with observer-specific toolbar code now in a dedicated `toolbar.py` file ([e49d54b](https://github.com/dropseed/plain/commit/e49d54bfea))
|
|
19
|
+
|
|
20
|
+
### Upgrade instructions
|
|
21
|
+
|
|
22
|
+
- No changes required
|
|
23
|
+
|
|
3
24
|
## [0.3.7](https://github.com/dropseed/plain/releases/plain-observer@0.3.7) (2025-08-22)
|
|
4
25
|
|
|
5
26
|
### What's changed
|
plain/observer/admin.py
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
from functools import cached_property
|
|
2
|
-
|
|
3
|
-
from plain.admin.toolbar import ToolbarPanel, register_toolbar_panel
|
|
4
1
|
from plain.admin.views import (
|
|
5
2
|
AdminModelDetailView,
|
|
6
3
|
AdminModelListView,
|
|
@@ -8,7 +5,6 @@ from plain.admin.views import (
|
|
|
8
5
|
register_viewset,
|
|
9
6
|
)
|
|
10
7
|
|
|
11
|
-
from .core import Observer
|
|
12
8
|
from .models import Span, Trace
|
|
13
9
|
|
|
14
10
|
|
|
@@ -40,7 +36,7 @@ class TraceViewset(AdminViewset):
|
|
|
40
36
|
class SpanViewset(AdminViewset):
|
|
41
37
|
class ListView(AdminModelListView):
|
|
42
38
|
nav_section = "Observer"
|
|
43
|
-
nav_icon = "
|
|
39
|
+
nav_icon = "activity"
|
|
44
40
|
model = Span
|
|
45
41
|
fields = [
|
|
46
42
|
"name",
|
|
@@ -81,20 +77,3 @@ class SpanViewset(AdminViewset):
|
|
|
81
77
|
|
|
82
78
|
class DetailView(AdminModelDetailView):
|
|
83
79
|
model = Span
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
@register_toolbar_panel
|
|
87
|
-
class ObserverToolbarPanel(ToolbarPanel):
|
|
88
|
-
name = "Observer"
|
|
89
|
-
template_name = "toolbar/observer.html"
|
|
90
|
-
button_template_name = "toolbar/observer_button.html"
|
|
91
|
-
|
|
92
|
-
@cached_property
|
|
93
|
-
def observer(self):
|
|
94
|
-
"""Get the Observer instance for this request."""
|
|
95
|
-
return Observer(self.request)
|
|
96
|
-
|
|
97
|
-
def get_template_context(self):
|
|
98
|
-
context = super().get_template_context()
|
|
99
|
-
context["observer"] = self.observer
|
|
100
|
-
return context
|
plain/observer/cli.py
CHANGED
plain/observer/core.py
CHANGED
|
@@ -13,7 +13,8 @@ class Observer:
|
|
|
13
13
|
"""Central class for managing observer state and operations."""
|
|
14
14
|
|
|
15
15
|
COOKIE_NAME = "observer"
|
|
16
|
-
|
|
16
|
+
SUMMARY_COOKIE_DURATION = 60 * 60 * 24 * 7 # 1 week in seconds
|
|
17
|
+
PERSIST_COOKIE_DURATION = 60 * 60 * 24 # 1 day in seconds
|
|
17
18
|
|
|
18
19
|
def __init__(self, request):
|
|
19
20
|
self.request = request
|
|
@@ -41,19 +42,25 @@ class Observer:
|
|
|
41
42
|
def enable_summary_mode(self, response):
|
|
42
43
|
"""Enable summary mode (real-time monitoring, no DB export)."""
|
|
43
44
|
response.set_signed_cookie(
|
|
44
|
-
self.COOKIE_NAME,
|
|
45
|
+
self.COOKIE_NAME,
|
|
46
|
+
ObserverMode.SUMMARY.value,
|
|
47
|
+
max_age=self.SUMMARY_COOKIE_DURATION,
|
|
45
48
|
)
|
|
46
49
|
|
|
47
50
|
def enable_persist_mode(self, response):
|
|
48
51
|
"""Enable full persist mode (real-time monitoring + DB export)."""
|
|
49
52
|
response.set_signed_cookie(
|
|
50
|
-
self.COOKIE_NAME,
|
|
53
|
+
self.COOKIE_NAME,
|
|
54
|
+
ObserverMode.PERSIST.value,
|
|
55
|
+
max_age=self.PERSIST_COOKIE_DURATION,
|
|
51
56
|
)
|
|
52
57
|
|
|
53
58
|
def disable(self, response):
|
|
54
59
|
"""Disable observer by setting cookie to disabled."""
|
|
55
60
|
response.set_signed_cookie(
|
|
56
|
-
self.COOKIE_NAME,
|
|
61
|
+
self.COOKIE_NAME,
|
|
62
|
+
ObserverMode.DISABLED.value,
|
|
63
|
+
max_age=self.PERSIST_COOKIE_DURATION,
|
|
57
64
|
)
|
|
58
65
|
|
|
59
66
|
def get_current_trace_summary(self):
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from functools import cached_property
|
|
2
|
+
|
|
3
|
+
from plain.toolbar import ToolbarPanel, register_toolbar_panel
|
|
4
|
+
|
|
5
|
+
from .core import Observer
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@register_toolbar_panel
|
|
9
|
+
class ObserverToolbarPanel(ToolbarPanel):
|
|
10
|
+
name = "Observer"
|
|
11
|
+
template_name = "toolbar/observer.html"
|
|
12
|
+
button_template_name = "toolbar/observer_button.html"
|
|
13
|
+
|
|
14
|
+
@cached_property
|
|
15
|
+
def observer(self):
|
|
16
|
+
"""Get the Observer instance for this request."""
|
|
17
|
+
return Observer(self.request)
|
|
18
|
+
|
|
19
|
+
def get_template_context(self):
|
|
20
|
+
context = super().get_template_context()
|
|
21
|
+
context["observer"] = self.observer
|
|
22
|
+
return context
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
plain/observer/CHANGELOG.md,sha256=
|
|
1
|
+
plain/observer/CHANGELOG.md,sha256=dY_jT_IisTqQOzhirekm0fNhsJQcx6MrGML5OhCuHYo,6735
|
|
2
2
|
plain/observer/README.md,sha256=39RA17fgcyOkqeIWBOAg4Be6YZjoiDzK5PVOG-nseuY,988
|
|
3
3
|
plain/observer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
plain/observer/admin.py,sha256=
|
|
5
|
-
plain/observer/cli.py,sha256=
|
|
4
|
+
plain/observer/admin.py,sha256=AsX6uGjIHN7EWu1Ez4VY8yYHiCydZ6bv7HCig9W9SI4,2096
|
|
5
|
+
plain/observer/cli.py,sha256=Jh5OwTtKmV6TTymfS9xv1R_tQL1tgfKKUS__19Wcnbk,20647
|
|
6
6
|
plain/observer/config.py,sha256=FuJi1jiDSvOTcmP-6Ea4OlGZt5cRf4iTp1e0dgpJ45E,1494
|
|
7
|
-
plain/observer/core.py,sha256=
|
|
7
|
+
plain/observer/core.py,sha256=ZHwQAXlqKa1BvHh3Xr6R0iOgkSNTEJ_Wg2lUlgMzWsE,2420
|
|
8
8
|
plain/observer/default_settings.py,sha256=JN2jT2wfa6f80EqU0p4Ox_47xyxL-Ym5-_pftY7xj2U,197
|
|
9
9
|
plain/observer/models.py,sha256=ZHu5SLWEpb4wOqQelGqAFmwSORCLH2H7T9GUYAoeLN0,13118
|
|
10
10
|
plain/observer/otel.py,sha256=9OUvAJfEXBVuFIIs3CZZ8IYHu-QxRFklbPBtEVHHz54,14645
|
|
11
|
+
plain/observer/toolbar.py,sha256=He7SqjED-7smLDWoomZ9df35qN4WcslNXi5eaO7X4lY,617
|
|
11
12
|
plain/observer/urls.py,sha256=oLJoDjB7YMUx8z-MGql_xXSXkfacVKFp-aHNXaKzs38,376
|
|
12
13
|
plain/observer/views.py,sha256=bPBByjs1ZlsN-9wgiO4OqQYR9uPXBYnasqV2ZZLJU0Q,4626
|
|
13
14
|
plain/observer/migrations/0001_initial.py,sha256=HVoSrd5V-IOqD1adADIAzqMH8xMlPwyLOFH6JcGFniI,3312
|
|
@@ -20,7 +21,7 @@ plain/observer/templates/observer/trace_share.html,sha256=HrYLti5BpX96-6Bm_37OOb
|
|
|
20
21
|
plain/observer/templates/observer/traces.html,sha256=cFnlIuCf6XJEpHRD2_yfVmPDGZfiqMq6Cg-iMlT3CWY,22184
|
|
21
22
|
plain/observer/templates/toolbar/observer.html,sha256=uaDKiWR7EYqC1kEXE-uHDlE7nfFEMR_zmOgvlKwQHJ4,1365
|
|
22
23
|
plain/observer/templates/toolbar/observer_button.html,sha256=FMBJHKMGqpHWs-3Ei2PBCdVYZ_6vFw6-eKH_i4jQu-Q,1215
|
|
23
|
-
plain_observer-0.
|
|
24
|
-
plain_observer-0.
|
|
25
|
-
plain_observer-0.
|
|
26
|
-
plain_observer-0.
|
|
24
|
+
plain_observer-0.5.0.dist-info/METADATA,sha256=wpz5Pi6iYS5jpWgbusejdnoPrQir1nZ2VQiRZt4BOnE,1386
|
|
25
|
+
plain_observer-0.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
plain_observer-0.5.0.dist-info/licenses/LICENSE,sha256=YZdq6Pz8ivjs97eSVLRmoGDI1hjEikX6N49DfM0DWio,1500
|
|
27
|
+
plain_observer-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|