plain.observer 0.3.1__tar.gz → 0.3.3__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.

Potentially problematic release.


This version of plain.observer might be problematic. Click here for more details.

Files changed (28) hide show
  1. plain_observer-0.3.3/PKG-INFO +52 -0
  2. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/CHANGELOG.md +22 -0
  3. plain_observer-0.3.3/plain/observer/README.md +39 -0
  4. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/cli.py +12 -22
  5. {plain_observer-0.3.1 → plain_observer-0.3.3}/pyproject.toml +1 -1
  6. plain_observer-0.3.1/PKG-INFO +0 -16
  7. plain_observer-0.3.1/plain/observer/README.md +0 -3
  8. {plain_observer-0.3.1 → plain_observer-0.3.3}/.gitignore +0 -0
  9. {plain_observer-0.3.1 → plain_observer-0.3.3}/LICENSE +0 -0
  10. {plain_observer-0.3.1 → plain_observer-0.3.3}/README.md +0 -0
  11. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/__init__.py +0 -0
  12. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/admin.py +0 -0
  13. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/config.py +0 -0
  14. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/core.py +0 -0
  15. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/default_settings.py +0 -0
  16. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/migrations/0001_initial.py +0 -0
  17. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/migrations/0002_trace_share_created_at_trace_share_id_trace_summary_and_more.py +0 -0
  18. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/migrations/__init__.py +0 -0
  19. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/models.py +0 -0
  20. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/otel.py +0 -0
  21. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/templates/observer/trace.html +0 -0
  22. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/templates/observer/trace_detail.html +0 -0
  23. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/templates/observer/trace_share.html +0 -0
  24. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/templates/observer/traces.html +0 -0
  25. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/templates/toolbar/observer.html +0 -0
  26. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/templates/toolbar/observer_button.html +0 -0
  27. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/urls.py +0 -0
  28. {plain_observer-0.3.1 → plain_observer-0.3.3}/plain/observer/views.py +0 -0
@@ -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,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
@@ -0,0 +1,39 @@
1
+ # plain.observer
2
+
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
+ ```
@@ -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
- def diagnose(trace_id, url, json_input, agent_command):
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! Tell me that and ask whether there are specific things we should look deeper into.",
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
- if agent_command:
560
- cmd = shlex.split(agent_command)
561
- cmd.append(prompt)
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()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.observer"
3
- version = "0.3.1"
3
+ version = "0.3.3"
4
4
  description = "On-page telemetry and observability tools for Plain."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  license = "BSD-3-Clause"
@@ -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.**
@@ -1,3 +0,0 @@
1
- # plain.observer
2
-
3
- **Monitor.**
File without changes
File without changes