plain.observer 0.6.0__py3-none-any.whl → 0.6.2__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 +22 -0
- plain/observer/config.py +6 -0
- plain/observer/logging.py +3 -2
- plain/observer/models.py +0 -11
- plain/observer/otel.py +4 -2
- plain/observer/templates/observer/partials/log.html +2 -6
- plain/observer/templates/observer/traces.html +5 -9
- {plain_observer-0.6.0.dist-info → plain_observer-0.6.2.dist-info}/METADATA +1 -1
- {plain_observer-0.6.0.dist-info → plain_observer-0.6.2.dist-info}/RECORD +11 -11
- {plain_observer-0.6.0.dist-info → plain_observer-0.6.2.dist-info}/WHEEL +0 -0
- {plain_observer-0.6.0.dist-info → plain_observer-0.6.2.dist-info}/licenses/LICENSE +0 -0
plain/observer/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# plain-observer changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.2](https://github.com/dropseed/plain/releases/plain-observer@0.6.2) (2025-09-09)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Improved traces sidebar layout by simplifying the display structure and making better use of space ([da789d19](https://github.com/dropseed/plain/commit/da789d1926))
|
|
8
|
+
|
|
9
|
+
### Upgrade instructions
|
|
10
|
+
|
|
11
|
+
- No changes required
|
|
12
|
+
|
|
13
|
+
## [0.6.1](https://github.com/dropseed/plain/releases/plain-observer@0.6.1) (2025-09-09)
|
|
14
|
+
|
|
15
|
+
### What's changed
|
|
16
|
+
|
|
17
|
+
- Log messages are now stored in their formatted form instead of as raw log records, improving display consistency and performance ([b646699](https://github.com/dropseed/plain/commit/b646699e46))
|
|
18
|
+
- Observer log handler now copies the formatter from the app logger to ensure consistent log formatting ([b646699](https://github.com/dropseed/plain/commit/b646699e46))
|
|
19
|
+
- Simplified log display template by removing redundant level display element ([b646699](https://github.com/dropseed/plain/commit/b646699e46))
|
|
20
|
+
|
|
21
|
+
### Upgrade instructions
|
|
22
|
+
|
|
23
|
+
- No changes required
|
|
24
|
+
|
|
3
25
|
## [0.6.0](https://github.com/dropseed/plain/releases/plain-observer@0.6.0) (2025-09-09)
|
|
4
26
|
|
|
5
27
|
### What's changed
|
plain/observer/config.py
CHANGED
|
@@ -46,6 +46,12 @@ class Config(PackageConfig):
|
|
|
46
46
|
|
|
47
47
|
# Install the logging handler to capture logs during traces
|
|
48
48
|
if observer_log_handler not in app_logger.handlers:
|
|
49
|
+
# Copy formatter from existing app_logger handler to match log formatting
|
|
50
|
+
for handler in app_logger.handlers:
|
|
51
|
+
if handler.formatter:
|
|
52
|
+
observer_log_handler.setFormatter(handler.formatter)
|
|
53
|
+
break
|
|
54
|
+
|
|
49
55
|
app_logger.addHandler(observer_log_handler)
|
|
50
56
|
|
|
51
57
|
@staticmethod
|
plain/observer/logging.py
CHANGED
|
@@ -44,9 +44,10 @@ class ObserverLogHandler(logging.Handler):
|
|
|
44
44
|
if trace_info["mode"] != ObserverMode.PERSIST.value:
|
|
45
45
|
return
|
|
46
46
|
|
|
47
|
-
# Store the
|
|
47
|
+
# Store the formatted message with span context
|
|
48
48
|
log_entry = {
|
|
49
|
-
"
|
|
49
|
+
"message": self.format(record),
|
|
50
|
+
"level": record.levelname,
|
|
50
51
|
"span_id": span_id,
|
|
51
52
|
"timestamp": datetime.fromtimestamp(record.created, tz=UTC),
|
|
52
53
|
}
|
plain/observer/models.py
CHANGED
|
@@ -500,14 +500,3 @@ class Log(models.Model):
|
|
|
500
500
|
models.Index(fields=["timestamp"]),
|
|
501
501
|
models.Index(fields=["trace"]),
|
|
502
502
|
]
|
|
503
|
-
|
|
504
|
-
@classmethod
|
|
505
|
-
def from_log_record(cls, *, record, trace, span):
|
|
506
|
-
"""Create a Log instance from a Python log record."""
|
|
507
|
-
return cls(
|
|
508
|
-
trace=trace,
|
|
509
|
-
timestamp=datetime.fromtimestamp(record.created, tz=UTC),
|
|
510
|
-
level=record.levelname,
|
|
511
|
-
message=record.getMessage(),
|
|
512
|
-
span=span,
|
|
513
|
-
)
|
plain/observer/otel.py
CHANGED
|
@@ -353,9 +353,11 @@ class ObserverSpanProcessor(SpanProcessor):
|
|
|
353
353
|
|
|
354
354
|
log_models = []
|
|
355
355
|
for log_entry in logs:
|
|
356
|
-
log_model = Log
|
|
357
|
-
record=log_entry["record"],
|
|
356
|
+
log_model = Log(
|
|
358
357
|
trace=trace,
|
|
358
|
+
timestamp=log_entry["timestamp"],
|
|
359
|
+
level=log_entry["level"],
|
|
360
|
+
message=log_entry["message"],
|
|
359
361
|
span=span_id_to_model.get(log_entry["span_id"]),
|
|
360
362
|
)
|
|
361
363
|
log_models.append(log_model)
|
|
@@ -6,14 +6,10 @@
|
|
|
6
6
|
</svg>
|
|
7
7
|
</div>
|
|
8
8
|
<span class="text-white/40 whitespace-nowrap tabular-nums" title="{{ log.timestamp|localtime }}">{{ log.timestamp|localtime|strftime("%-I:%M:%S %p") }}</span>
|
|
9
|
-
<span class="font-mono
|
|
9
|
+
<span data-level="{{ log.level }}" class="font-mono text-white/90 break-words
|
|
10
10
|
data-[level='DEBUG']:text-stone-400
|
|
11
|
-
data-[level='INFO']:text-blue-400
|
|
12
11
|
data-[level='WARNING']:text-yellow-400
|
|
13
12
|
data-[level='ERROR']:text-red-400
|
|
14
|
-
data-[level='CRITICAL']:text-red-300
|
|
15
|
-
text-stone-400 text-center flex-shrink-0"
|
|
16
|
-
data-level="{{ log.level }}">{{ log.level }}</span>
|
|
17
|
-
<span class="font-mono text-white/90 break-words">{{ log.message }}</span>
|
|
13
|
+
data-[level='CRITICAL']:text-red-300">{{ log.message }}</span>
|
|
18
14
|
</div>
|
|
19
15
|
</div>
|
|
@@ -90,15 +90,12 @@
|
|
|
90
90
|
hx-swap="innerHTML"
|
|
91
91
|
class="block w-full text-left p-3 transition-colors hover:bg-white/5 focus:outline-none focus:bg-white/5"
|
|
92
92
|
data-trace-id="{{ trace_item.trace_id }}">
|
|
93
|
-
<div class="flex items-
|
|
93
|
+
<div class="flex items-center justify-between gap-2">
|
|
94
94
|
<div class="flex-1 min-w-0">
|
|
95
95
|
{% if trace_item.root_span_name %}
|
|
96
|
-
<div class="text-
|
|
96
|
+
<div class="text-xs font-medium text-white/90 truncate">{{ trace_item.root_span_name }}</div>
|
|
97
97
|
{% else %}
|
|
98
|
-
<div class="text-
|
|
99
|
-
{% endif %}
|
|
100
|
-
{% if trace_item.summary %}
|
|
101
|
-
<div class="text-xs text-white/75 mt-1">{{ trace_item.summary }}</div>
|
|
98
|
+
<div class="text-xs font-medium text-white/30 font-mono truncate">{{ trace_item.trace_id }}</div>
|
|
102
99
|
{% endif %}
|
|
103
100
|
</div>
|
|
104
101
|
<div class="flex items-center gap-1.5 flex-shrink-0">
|
|
@@ -106,15 +103,14 @@
|
|
|
106
103
|
</div>
|
|
107
104
|
</div>
|
|
108
105
|
<div class="mt-1 space-y-1">
|
|
109
|
-
{% if trace_item.
|
|
106
|
+
{% if trace_item.summary %}<div class="text-xs text-white/60">{{ trace_item.summary }}</div>{% endif %}
|
|
107
|
+
{% if trace_item.share_id %}
|
|
110
108
|
<div class="flex items-center gap-1.5">
|
|
111
|
-
{% if trace_item.share_id %}
|
|
112
109
|
<div class="text-emerald-500 flex-shrink-0" title="Has active share link">
|
|
113
110
|
<svg class="w-3 h-3" fill="currentColor" viewBox="0 0 16 16">
|
|
114
111
|
<path d="M11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.5 2.5 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5"/>
|
|
115
112
|
</svg>
|
|
116
113
|
</div>
|
|
117
|
-
{% endif %}
|
|
118
114
|
<div class="text-xs text-white/30 font-mono truncate">{{ trace_item.trace_id }}</div>
|
|
119
115
|
</div>
|
|
120
116
|
{% endif %}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
plain/observer/CHANGELOG.md,sha256=
|
|
1
|
+
plain/observer/CHANGELOG.md,sha256=n4JSLw_w1fpU2snmEZP27H5napE458PMjsvV-wXEPdc,9295
|
|
2
2
|
plain/observer/README.md,sha256=39RA17fgcyOkqeIWBOAg4Be6YZjoiDzK5PVOG-nseuY,988
|
|
3
3
|
plain/observer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
plain/observer/admin.py,sha256=yvfkXD4kIosodEqkvJkqACIb6WOdNaHFRX_LGca5Aks,3391
|
|
5
5
|
plain/observer/cli.py,sha256=Jh5OwTtKmV6TTymfS9xv1R_tQL1tgfKKUS__19Wcnbk,20647
|
|
6
|
-
plain/observer/config.py,sha256=
|
|
6
|
+
plain/observer/config.py,sha256=8c5aX2_rzVL4SSFO4Q0nMyUSqgpu3Zv3aJkeFZONOpM,2434
|
|
7
7
|
plain/observer/core.py,sha256=ZHwQAXlqKa1BvHh3Xr6R0iOgkSNTEJ_Wg2lUlgMzWsE,2420
|
|
8
8
|
plain/observer/default_settings.py,sha256=JN2jT2wfa6f80EqU0p4Ox_47xyxL-Ym5-_pftY7xj2U,197
|
|
9
|
-
plain/observer/logging.py,sha256=
|
|
10
|
-
plain/observer/models.py,sha256=
|
|
11
|
-
plain/observer/otel.py,sha256=
|
|
9
|
+
plain/observer/logging.py,sha256=5_fcmUE0x2lg7968V4lhduaTbRLCr8w-ooRFo9BC1ms,2795
|
|
10
|
+
plain/observer/models.py,sha256=EJTUCDeJkG55XgTT1AUpYvEDU8KDgCVr1nexKKt4GQQ,17045
|
|
11
|
+
plain/observer/otel.py,sha256=h7LI7Nur8Y6XheriuNWPmeSFpf2Vsl94Sgxv02W8ZXY,16170
|
|
12
12
|
plain/observer/toolbar.py,sha256=He7SqjED-7smLDWoomZ9df35qN4WcslNXi5eaO7X4lY,617
|
|
13
13
|
plain/observer/urls.py,sha256=oLJoDjB7YMUx8z-MGql_xXSXkfacVKFp-aHNXaKzs38,376
|
|
14
14
|
plain/observer/views.py,sha256=8KoBwXBj2q-mbuscA80h7nlglsOraTz-ScTzTQwLWP0,4949
|
|
@@ -22,12 +22,12 @@ plain/observer/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
22
22
|
plain/observer/templates/observer/trace.html,sha256=Hd92O1lX0xjvDR7cb79NFVeJhxaVEA1mmyzvsRVKuwU,11362
|
|
23
23
|
plain/observer/templates/observer/trace_detail.html,sha256=86-YGCpg9gy31Pd2vDHB3LYRkJile-DsGD1Enjx9s5Y,943
|
|
24
24
|
plain/observer/templates/observer/trace_share.html,sha256=HrYLti5BpX96-6Bm_37OObFvAJSYbZ3GZD-MwCi9hgA,525
|
|
25
|
-
plain/observer/templates/observer/traces.html,sha256=
|
|
26
|
-
plain/observer/templates/observer/partials/log.html,sha256=
|
|
25
|
+
plain/observer/templates/observer/traces.html,sha256=Erz-25y5JFvdysskjpXEr_axM4ScdbuUuYwZ-SdgG3I,24358
|
|
26
|
+
plain/observer/templates/observer/partials/log.html,sha256=Vpp0j-GLBfwTBFyZp_cv0jkOLpgxfd-8-RMBe6V4HbU,964
|
|
27
27
|
plain/observer/templates/observer/partials/span.html,sha256=PaWZONsABwlS7mdKsJlYbhMSOzidq_WyOp6ifvFUgmM,18672
|
|
28
28
|
plain/observer/templates/toolbar/observer.html,sha256=uaDKiWR7EYqC1kEXE-uHDlE7nfFEMR_zmOgvlKwQHJ4,1365
|
|
29
29
|
plain/observer/templates/toolbar/observer_button.html,sha256=FMBJHKMGqpHWs-3Ei2PBCdVYZ_6vFw6-eKH_i4jQu-Q,1215
|
|
30
|
-
plain_observer-0.6.
|
|
31
|
-
plain_observer-0.6.
|
|
32
|
-
plain_observer-0.6.
|
|
33
|
-
plain_observer-0.6.
|
|
30
|
+
plain_observer-0.6.2.dist-info/METADATA,sha256=YJpxeMVWu0fwi6YkQPQvdBtwjUO-OblOIXnGzKR7uYQ,1386
|
|
31
|
+
plain_observer-0.6.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
32
|
+
plain_observer-0.6.2.dist-info/licenses/LICENSE,sha256=YZdq6Pz8ivjs97eSVLRmoGDI1hjEikX6N49DfM0DWio,1500
|
|
33
|
+
plain_observer-0.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|