plain.observer 0.3.1__py3-none-any.whl → 0.3.3__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/README.md +37 -1
- plain/observer/cli.py +12 -22
- plain_observer-0.3.3.dist-info/METADATA +52 -0
- {plain_observer-0.3.1.dist-info → plain_observer-0.3.3.dist-info}/RECORD +7 -7
- plain_observer-0.3.1.dist-info/METADATA +0 -16
- {plain_observer-0.3.1.dist-info → plain_observer-0.3.3.dist-info}/WHEEL +0 -0
- {plain_observer-0.3.1.dist-info → plain_observer-0.3.3.dist-info}/licenses/LICENSE +0 -0
plain/observer/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# plain-observer changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.3](https://github.com/dropseed/plain/releases/plain-observer@0.3.3) (2025-07-25)
|
|
4
|
+
|
|
5
|
+
### What's changed
|
|
6
|
+
|
|
7
|
+
- Added `--print` option to the `plain observer diagnose` command to print prompts without running agents ([9721331](https://github.com/dropseed/plain/commit/9721331e40))
|
|
8
|
+
- The `plain observer diagnose` command now uses the shared `prompt_agent` utility for better consistency ([de1fa72](https://github.com/dropseed/plain/commit/de1fa7253a))
|
|
9
|
+
- Added comprehensive installation instructions to the README including package installation, URL configuration, and migration steps ([950939b](https://github.com/dropseed/plain/commit/950939b619))
|
|
10
|
+
|
|
11
|
+
### Upgrade instructions
|
|
12
|
+
|
|
13
|
+
- No changes required
|
|
14
|
+
|
|
15
|
+
## [0.3.2](https://github.com/dropseed/plain/releases/plain-observer@0.3.2) (2025-07-25)
|
|
16
|
+
|
|
17
|
+
### What's changed
|
|
18
|
+
|
|
19
|
+
- The diagnose agent command now instructs the AI to examine the codebase before making suggestions ([f5ae388](https://github.com/dropseed/plain/commit/f5ae388833))
|
|
20
|
+
|
|
21
|
+
### Upgrade instructions
|
|
22
|
+
|
|
23
|
+
- No changes required
|
|
24
|
+
|
|
3
25
|
## [0.3.1](https://github.com/dropseed/plain/releases/plain-observer@0.3.1) (2025-07-23)
|
|
4
26
|
|
|
5
27
|
### What's changed
|
plain/observer/README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
1
|
# plain.observer
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**On-page telemetry and observability tools for Plain.**
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uv add plain.observer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Add `plain.observer` to your `INSTALLED_PACKAGES`:
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
# app/settings.py
|
|
15
|
+
INSTALLED_PACKAGES = [
|
|
16
|
+
# ...
|
|
17
|
+
"plain.observer",
|
|
18
|
+
]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Include the observer URLs in your URL configuration:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
# app/urls.py
|
|
25
|
+
from plain.urls import Router, include
|
|
26
|
+
|
|
27
|
+
class AppRouter(Router):
|
|
28
|
+
namespace = ""
|
|
29
|
+
urls = [
|
|
30
|
+
# ...
|
|
31
|
+
include("observer/", "plain.observer.urls"),
|
|
32
|
+
]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Run migrations to create the necessary database tables:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
plain migrate
|
|
39
|
+
```
|
plain/observer/cli.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import json
|
|
2
|
-
import shlex
|
|
3
|
-
import subprocess
|
|
4
2
|
import sys
|
|
5
3
|
import urllib.request
|
|
6
4
|
|
|
7
5
|
import click
|
|
8
6
|
|
|
9
7
|
from plain.cli import register_cli
|
|
8
|
+
from plain.cli.agent import prompt_agent
|
|
10
9
|
from plain.observer.models import Span, Trace
|
|
11
10
|
|
|
12
11
|
|
|
@@ -497,7 +496,13 @@ def format_trace_output(trace):
|
|
|
497
496
|
envvar="PLAIN_AGENT_COMMAND",
|
|
498
497
|
help="Run command with generated prompt",
|
|
499
498
|
)
|
|
500
|
-
|
|
499
|
+
@click.option(
|
|
500
|
+
"--print",
|
|
501
|
+
"print_only",
|
|
502
|
+
is_flag=True,
|
|
503
|
+
help="Print the prompt without running the agent",
|
|
504
|
+
)
|
|
505
|
+
def diagnose(trace_id, url, json_input, agent_command, print_only):
|
|
501
506
|
"""Generate a diagnostic prompt for analyzing a trace.
|
|
502
507
|
|
|
503
508
|
By default, provide a trace ID from the database. Use --url for a shareable
|
|
@@ -543,7 +548,7 @@ def diagnose(trace_id, url, json_input, agent_command):
|
|
|
543
548
|
prompt_lines = [
|
|
544
549
|
"I have an OpenTelemetry trace data JSON from a Plain application. Analyze it for performance issues or improvements.",
|
|
545
550
|
"",
|
|
546
|
-
"Focus on easy and obvious wins first and foremost. If there is nothing obvious, that's ok
|
|
551
|
+
"Focus on easy and obvious wins first and foremost. You have access to the codebase, so make sure you look at it before suggesting anything! If there is nothing obvious, that's ok -- tell me that and ask whether there are specific things we should look deeper into.",
|
|
547
552
|
"",
|
|
548
553
|
"If potential code changes are found, briefly explain them and ask whether we should implement them.",
|
|
549
554
|
"",
|
|
@@ -556,21 +561,6 @@ def diagnose(trace_id, url, json_input, agent_command):
|
|
|
556
561
|
|
|
557
562
|
prompt = "\n".join(prompt_lines)
|
|
558
563
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
result = subprocess.run(cmd, check=False)
|
|
563
|
-
if result.returncode != 0:
|
|
564
|
-
click.secho(
|
|
565
|
-
f"Agent command failed with exit code {result.returncode}",
|
|
566
|
-
fg="red",
|
|
567
|
-
err=True,
|
|
568
|
-
)
|
|
569
|
-
else:
|
|
570
|
-
click.echo(prompt)
|
|
571
|
-
click.secho(
|
|
572
|
-
"\nCopy the prompt above to a coding agent. To run an agent automatically, use --agent-command or set the PLAIN_AGENT_COMMAND environment variable.",
|
|
573
|
-
dim=True,
|
|
574
|
-
italic=True,
|
|
575
|
-
err=True,
|
|
576
|
-
)
|
|
564
|
+
success = prompt_agent(prompt, agent_command, print_only)
|
|
565
|
+
if not success:
|
|
566
|
+
raise click.Abort()
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: plain.observer
|
|
3
|
+
Version: 0.3.3
|
|
4
|
+
Summary: On-page telemetry and observability tools for Plain.
|
|
5
|
+
Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: opentelemetry-sdk>=1.34.1
|
|
10
|
+
Requires-Dist: plain-admin<1.0.0
|
|
11
|
+
Requires-Dist: plain<1.0.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# plain.observer
|
|
15
|
+
|
|
16
|
+
**On-page telemetry and observability tools for Plain.**
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv add plain.observer
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Add `plain.observer` to your `INSTALLED_PACKAGES`:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
# app/settings.py
|
|
28
|
+
INSTALLED_PACKAGES = [
|
|
29
|
+
# ...
|
|
30
|
+
"plain.observer",
|
|
31
|
+
]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Include the observer URLs in your URL configuration:
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
# app/urls.py
|
|
38
|
+
from plain.urls import Router, include
|
|
39
|
+
|
|
40
|
+
class AppRouter(Router):
|
|
41
|
+
namespace = ""
|
|
42
|
+
urls = [
|
|
43
|
+
# ...
|
|
44
|
+
include("observer/", "plain.observer.urls"),
|
|
45
|
+
]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Run migrations to create the necessary database tables:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
plain migrate
|
|
52
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
plain/observer/CHANGELOG.md,sha256=
|
|
2
|
-
plain/observer/README.md,sha256=
|
|
1
|
+
plain/observer/CHANGELOG.md,sha256=r0_rxaPSTqGZHICwXhYLNiApmrXqzBf_VUV-J9uFB84,4048
|
|
2
|
+
plain/observer/README.md,sha256=hHpKfD75aDnQMy1bY39uNSVoXqSSIcIKcHN_JaJMEZs,606
|
|
3
3
|
plain/observer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
plain/observer/admin.py,sha256=Csvd5V9F5u0zksWpbpISY_NlBJa-0TptSX_Kn652WRc,2719
|
|
5
|
-
plain/observer/cli.py,sha256
|
|
5
|
+
plain/observer/cli.py,sha256=oP_aeno-xYQ2YemQVNFwhmLevDdkf1uLRk-wpOUxqdU,20640
|
|
6
6
|
plain/observer/config.py,sha256=FuJi1jiDSvOTcmP-6Ea4OlGZt5cRf4iTp1e0dgpJ45E,1494
|
|
7
7
|
plain/observer/core.py,sha256=D9vX0GP8JBB8-NFAKrOwPSHl_wdZo1h0A5C6xKsJVjA,2245
|
|
8
8
|
plain/observer/default_settings.py,sha256=JN2jT2wfa6f80EqU0p4Ox_47xyxL-Ym5-_pftY7xj2U,197
|
|
@@ -19,7 +19,7 @@ plain/observer/templates/observer/trace_share.html,sha256=HrYLti5BpX96-6Bm_37OOb
|
|
|
19
19
|
plain/observer/templates/observer/traces.html,sha256=cFnlIuCf6XJEpHRD2_yfVmPDGZfiqMq6Cg-iMlT3CWY,22184
|
|
20
20
|
plain/observer/templates/toolbar/observer.html,sha256=uaDKiWR7EYqC1kEXE-uHDlE7nfFEMR_zmOgvlKwQHJ4,1365
|
|
21
21
|
plain/observer/templates/toolbar/observer_button.html,sha256=xsHJSuOjW6ddnxlPlPKek22WrWnuVYGIcBfFdkb76pk,1199
|
|
22
|
-
plain_observer-0.3.
|
|
23
|
-
plain_observer-0.3.
|
|
24
|
-
plain_observer-0.3.
|
|
25
|
-
plain_observer-0.3.
|
|
22
|
+
plain_observer-0.3.3.dist-info/METADATA,sha256=N34q8Ad8ad72MSkZtndP9woazPgI54Eylicz0hLT8qg,1004
|
|
23
|
+
plain_observer-0.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
24
|
+
plain_observer-0.3.3.dist-info/licenses/LICENSE,sha256=YZdq6Pz8ivjs97eSVLRmoGDI1hjEikX6N49DfM0DWio,1500
|
|
25
|
+
plain_observer-0.3.3.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: plain.observer
|
|
3
|
-
Version: 0.3.1
|
|
4
|
-
Summary: On-page telemetry and observability tools for Plain.
|
|
5
|
-
Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
|
|
6
|
-
License-Expression: BSD-3-Clause
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Requires-Python: >=3.11
|
|
9
|
-
Requires-Dist: opentelemetry-sdk>=1.34.1
|
|
10
|
-
Requires-Dist: plain-admin<1.0.0
|
|
11
|
-
Requires-Dist: plain<1.0.0
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
|
|
14
|
-
# plain.observer
|
|
15
|
-
|
|
16
|
-
**Monitor.**
|
|
File without changes
|
|
File without changes
|