glowtrace 0.3.0__tar.gz → 0.3.2__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 glowtrace might be problematic. Click here for more details.

@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: glowtrace
3
+ Version: 0.3.2
4
+ Summary: See your multi-agent LLM app as a live graph: which agent is running, what it sent, and what came back.
5
+ Author: Eman Khadim
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/emankhadim/glowtrace
8
+ Project-URL: Source, https://github.com/emankhadim/glowtrace
9
+ Project-URL: Issues, https://github.com/emankhadim/glowtrace/issues
10
+ Keywords: agents,llm,opentelemetry,observability,tracing,multi-agent,visualization,genai
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Debuggers
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Classifier: Framework :: AsyncIO
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: aiohttp>=3.9
23
+ Requires-Dist: opentelemetry-proto>=1.20
24
+ Requires-Dist: websockets>=13
25
+ Provides-Extra: live
26
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == "live"
27
+ Dynamic: license-file
28
+
29
+ <h1><img src="https://raw.githubusercontent.com/emankhadim/glowtrace/main/docs/logo.png" alt="glowtrace" width="360"></h1>
30
+
31
+ [![PyPI](https://img.shields.io/pypi/v/glowtrace)](https://pypi.org/project/glowtrace/)
32
+ [![Python](https://img.shields.io/pypi/pyversions/glowtrace)](https://pypi.org/project/glowtrace/)
33
+ [![License: MIT](https://img.shields.io/badge/license-MIT-yellow)](https://github.com/emankhadim/glowtrace/blob/main/LICENSE)
34
+
35
+ **See your multi-agent app as a live graph: which agent is running, who it handed work to, and the exact prompt behind every step.**
36
+
37
+ ![glowtrace demo](https://raw.githubusercontent.com/emankhadim/glowtrace/main/docs/demo.gif)
38
+
39
+ When three or four agents start passing work to each other, logs stop being enough. You can't tell which agent is stuck, which tool call failed, or what prompt actually went to the model. glowtrace shows you that while the run is happening.
40
+
41
+ - **Two commands, no code changes** for apps that already export OpenTelemetry traces
42
+ - **Live graph:** agents, LLM calls and tool calls appear as they run; failures turn red
43
+ - **Click any node** for the system prompt, messages, response, tool args and results, tokens and timing
44
+ - **Readable by default:** framework internals like `RunnableSequence` and prompt templates are folded away
45
+ - **Works across frameworks** that use OpenInference, OpenTelemetry GenAI or OpenLLMetry spans (tested end to end with LangGraph so far)
46
+
47
+ It's a debugging view for runs in progress. For stored history, evals and cost tracking, use it next to Phoenix or Langfuse rather than instead of them.
48
+
49
+ ## Install and run
50
+
51
+ ```bash
52
+ pip install glowtrace
53
+ glowtrace serve
54
+ ```
55
+
56
+ The UI is at http://localhost:4318. Port 4318 is the default OTLP/HTTP port, so an app that already exports traces with default settings needs no changes. Otherwise:
57
+
58
+ ```bash
59
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
60
+ export OTEL_BSP_SCHEDULE_DELAY=200 # optional, the default batch delay is 5 s
61
+ ```
62
+
63
+ OTLP exporters only send a span when it ends, so by default a node appears once its step has finished. To see steps while they are still running, add this to your app (needs `pip install "glowtrace[live]"`):
64
+
65
+ ```python
66
+ import glowtrace
67
+ glowtrace.instrument()
68
+ ```
69
+
70
+ ## What it reads
71
+
72
+ glowtrace maps spans that follow any of these conventions:
73
+
74
+ - [OpenInference](https://github.com/Arize-ai/openinference), used by the instrumentors for LangChain/LangGraph, LlamaIndex, CrewAI, the OpenAI Agents SDK and others
75
+ - [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (`gen_ai.*`)
76
+ - [OpenLLMetry](https://github.com/traceloop/openllmetry) (`traceloop.*`)
77
+
78
+ So far I have tested it end to end with LangGraph and with the unmodified [langgraph-supervisor](https://github.com/langchain-ai/langgraph-supervisor-py) quickstart. The other conventions are covered by unit tests, not by real runs. If a framework shows up wrong, an issue with the trace attached helps most.
79
+
80
+ Spans that carry no agent, LLM or tool meaning (HTTP calls, prompt templates, `RunnableSequence` and similar) are folded into their parent so the graph stays readable. `glowtrace serve --all-spans` turns this off.
81
+
82
+ ### LangGraph setup
83
+
84
+ ```python
85
+ from openinference.instrumentation.langchain import LangChainInstrumentor
86
+ from opentelemetry import trace
87
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
88
+ from opentelemetry.sdk.trace import TracerProvider
89
+ from opentelemetry.sdk.trace.export import BatchSpanProcessor
90
+ import glowtrace
91
+
92
+ provider = TracerProvider()
93
+ provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
94
+ trace.set_tracer_provider(provider)
95
+ glowtrace.instrument() # optional
96
+ LangChainInstrumentor().instrument(tracer_provider=provider)
97
+ ```
98
+
99
+ ### Without OpenTelemetry
100
+
101
+ There is a small tracer for plain Python code:
102
+
103
+ ```python
104
+ from glowtrace import Tracer
105
+
106
+ tr = Tracer()
107
+ tr.session("orch", "Orchestrator", input=question)
108
+ with tr.agent("a1", "researcher", parent="orch", system=SYSTEM, input=task) as a:
109
+ with tr.tool("t1", "sql_query", parent="a1", args=sql) as t:
110
+ t.result = run(sql)
111
+ a.output, a.tokens = answer, usage
112
+ ```
113
+
114
+ It sends JSON events over the `/ws` WebSocket, so any language can do the same:
115
+
116
+ | event | fields |
117
+ |---|---|
118
+ | `node` | `id, kind (session/step/agent/llm/tool), parent, title, status, model, system, input, args` |
119
+ | `update` | `id, status (waiting/running/done/error), note, output, result, tokens` |
120
+ | `message` | `from, to, content, label, tokens` |
121
+ | `remove` | `id` (its children move up to its parent) |
122
+
123
+ ## Examples
124
+
125
+ The examples in `examples/` work with any OpenAI-compatible endpoint, including a local model through Ollama. Set `LLM_BASE_URL`, `LLM_API_KEY` and `LLM_MODEL` to point them somewhere else.
126
+
127
+ ```bash
128
+ pip install "glowtrace[live]" openai langgraph langchain-openai langgraph-supervisor \
129
+ openinference-instrumentation-langchain opentelemetry-exporter-otlp-proto-http
130
+ python examples/test_supervisor.py # langgraph-supervisor quickstart
131
+ python examples/langgraph_team.py # small LangGraph team
132
+ python examples/real_agents.py # plain Python agents with the native tracer
133
+ python examples/fake_run.py # scripted events, no LLM
134
+ ```
135
+
136
+ ## Limitations
137
+
138
+ - History is kept in memory only (the last 20,000 events) and is gone when the server stops. glowtrace is not a replacement for Phoenix or Langfuse if you need stored traces, evals or cost tracking.
139
+ - One process, no auth beyond an optional write token (`--token`). Without the token anyone who can reach the port can send data.
140
+ - Large runs with hundreds of nodes get crowded on screen.
141
+
142
+ ## How it works
143
+
144
+ ```
145
+ your app --OTLP/HTTP--> glowtrace serve --WebSocket--> browser
146
+ ```
147
+
148
+ The server accepts protobuf or JSON OTLP, turns spans into graph events, and keeps a history so a tab opened mid-run can catch up. Exporters often send child spans before their parents, so an unknown parent gets a placeholder node that is filled in when its span arrives.
149
+
150
+ The UI is TypeScript without a framework. It builds into one HTML file that ships inside the Python package, so `pip install` does not need Node.
151
+
152
+ ## Development
153
+
154
+ ```bash
155
+ pip install -e ".[live]" pytest && pytest
156
+ cd web && npm install && npm test && npm run build
157
+ ```
158
+
159
+ `glowtrace/` holds the server, the span mapper and the tracer. `web/src/` holds the UI. The built `glowtrace/static/index.html` is committed and CI checks that it matches the source.
160
+
161
+ MIT License
@@ -0,0 +1,133 @@
1
+ <h1><img src="https://raw.githubusercontent.com/emankhadim/glowtrace/main/docs/logo.png" alt="glowtrace" width="360"></h1>
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/glowtrace)](https://pypi.org/project/glowtrace/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/glowtrace)](https://pypi.org/project/glowtrace/)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-yellow)](https://github.com/emankhadim/glowtrace/blob/main/LICENSE)
6
+
7
+ **See your multi-agent app as a live graph: which agent is running, who it handed work to, and the exact prompt behind every step.**
8
+
9
+ ![glowtrace demo](https://raw.githubusercontent.com/emankhadim/glowtrace/main/docs/demo.gif)
10
+
11
+ When three or four agents start passing work to each other, logs stop being enough. You can't tell which agent is stuck, which tool call failed, or what prompt actually went to the model. glowtrace shows you that while the run is happening.
12
+
13
+ - **Two commands, no code changes** for apps that already export OpenTelemetry traces
14
+ - **Live graph:** agents, LLM calls and tool calls appear as they run; failures turn red
15
+ - **Click any node** for the system prompt, messages, response, tool args and results, tokens and timing
16
+ - **Readable by default:** framework internals like `RunnableSequence` and prompt templates are folded away
17
+ - **Works across frameworks** that use OpenInference, OpenTelemetry GenAI or OpenLLMetry spans (tested end to end with LangGraph so far)
18
+
19
+ It's a debugging view for runs in progress. For stored history, evals and cost tracking, use it next to Phoenix or Langfuse rather than instead of them.
20
+
21
+ ## Install and run
22
+
23
+ ```bash
24
+ pip install glowtrace
25
+ glowtrace serve
26
+ ```
27
+
28
+ The UI is at http://localhost:4318. Port 4318 is the default OTLP/HTTP port, so an app that already exports traces with default settings needs no changes. Otherwise:
29
+
30
+ ```bash
31
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
32
+ export OTEL_BSP_SCHEDULE_DELAY=200 # optional, the default batch delay is 5 s
33
+ ```
34
+
35
+ OTLP exporters only send a span when it ends, so by default a node appears once its step has finished. To see steps while they are still running, add this to your app (needs `pip install "glowtrace[live]"`):
36
+
37
+ ```python
38
+ import glowtrace
39
+ glowtrace.instrument()
40
+ ```
41
+
42
+ ## What it reads
43
+
44
+ glowtrace maps spans that follow any of these conventions:
45
+
46
+ - [OpenInference](https://github.com/Arize-ai/openinference), used by the instrumentors for LangChain/LangGraph, LlamaIndex, CrewAI, the OpenAI Agents SDK and others
47
+ - [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (`gen_ai.*`)
48
+ - [OpenLLMetry](https://github.com/traceloop/openllmetry) (`traceloop.*`)
49
+
50
+ So far I have tested it end to end with LangGraph and with the unmodified [langgraph-supervisor](https://github.com/langchain-ai/langgraph-supervisor-py) quickstart. The other conventions are covered by unit tests, not by real runs. If a framework shows up wrong, an issue with the trace attached helps most.
51
+
52
+ Spans that carry no agent, LLM or tool meaning (HTTP calls, prompt templates, `RunnableSequence` and similar) are folded into their parent so the graph stays readable. `glowtrace serve --all-spans` turns this off.
53
+
54
+ ### LangGraph setup
55
+
56
+ ```python
57
+ from openinference.instrumentation.langchain import LangChainInstrumentor
58
+ from opentelemetry import trace
59
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
60
+ from opentelemetry.sdk.trace import TracerProvider
61
+ from opentelemetry.sdk.trace.export import BatchSpanProcessor
62
+ import glowtrace
63
+
64
+ provider = TracerProvider()
65
+ provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
66
+ trace.set_tracer_provider(provider)
67
+ glowtrace.instrument() # optional
68
+ LangChainInstrumentor().instrument(tracer_provider=provider)
69
+ ```
70
+
71
+ ### Without OpenTelemetry
72
+
73
+ There is a small tracer for plain Python code:
74
+
75
+ ```python
76
+ from glowtrace import Tracer
77
+
78
+ tr = Tracer()
79
+ tr.session("orch", "Orchestrator", input=question)
80
+ with tr.agent("a1", "researcher", parent="orch", system=SYSTEM, input=task) as a:
81
+ with tr.tool("t1", "sql_query", parent="a1", args=sql) as t:
82
+ t.result = run(sql)
83
+ a.output, a.tokens = answer, usage
84
+ ```
85
+
86
+ It sends JSON events over the `/ws` WebSocket, so any language can do the same:
87
+
88
+ | event | fields |
89
+ |---|---|
90
+ | `node` | `id, kind (session/step/agent/llm/tool), parent, title, status, model, system, input, args` |
91
+ | `update` | `id, status (waiting/running/done/error), note, output, result, tokens` |
92
+ | `message` | `from, to, content, label, tokens` |
93
+ | `remove` | `id` (its children move up to its parent) |
94
+
95
+ ## Examples
96
+
97
+ The examples in `examples/` work with any OpenAI-compatible endpoint, including a local model through Ollama. Set `LLM_BASE_URL`, `LLM_API_KEY` and `LLM_MODEL` to point them somewhere else.
98
+
99
+ ```bash
100
+ pip install "glowtrace[live]" openai langgraph langchain-openai langgraph-supervisor \
101
+ openinference-instrumentation-langchain opentelemetry-exporter-otlp-proto-http
102
+ python examples/test_supervisor.py # langgraph-supervisor quickstart
103
+ python examples/langgraph_team.py # small LangGraph team
104
+ python examples/real_agents.py # plain Python agents with the native tracer
105
+ python examples/fake_run.py # scripted events, no LLM
106
+ ```
107
+
108
+ ## Limitations
109
+
110
+ - History is kept in memory only (the last 20,000 events) and is gone when the server stops. glowtrace is not a replacement for Phoenix or Langfuse if you need stored traces, evals or cost tracking.
111
+ - One process, no auth beyond an optional write token (`--token`). Without the token anyone who can reach the port can send data.
112
+ - Large runs with hundreds of nodes get crowded on screen.
113
+
114
+ ## How it works
115
+
116
+ ```
117
+ your app --OTLP/HTTP--> glowtrace serve --WebSocket--> browser
118
+ ```
119
+
120
+ The server accepts protobuf or JSON OTLP, turns spans into graph events, and keeps a history so a tab opened mid-run can catch up. Exporters often send child spans before their parents, so an unknown parent gets a placeholder node that is filled in when its span arrives.
121
+
122
+ The UI is TypeScript without a framework. It builds into one HTML file that ships inside the Python package, so `pip install` does not need Node.
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ pip install -e ".[live]" pytest && pytest
128
+ cd web && npm install && npm test && npm run build
129
+ ```
130
+
131
+ `glowtrace/` holds the server, the span mapper and the tracer. `web/src/` holds the UI. The built `glowtrace/static/index.html` is committed and CI checks that it matches the source.
132
+
133
+ MIT License
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  from .tracer import Tracer
5
5
 
6
6
  __all__ = ["Tracer", "instrument"]
7
- __version__ = "0.3.0"
7
+ __version__ = "0.3.2"
8
8
 
9
9
 
10
10
  def instrument(endpoint: str | None = None, service_name: str | None = None, token: str | None = None):
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: glowtrace
3
+ Version: 0.3.2
4
+ Summary: See your multi-agent LLM app as a live graph: which agent is running, what it sent, and what came back.
5
+ Author: Eman Khadim
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/emankhadim/glowtrace
8
+ Project-URL: Source, https://github.com/emankhadim/glowtrace
9
+ Project-URL: Issues, https://github.com/emankhadim/glowtrace/issues
10
+ Keywords: agents,llm,opentelemetry,observability,tracing,multi-agent,visualization,genai
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Debuggers
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Classifier: Framework :: AsyncIO
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: aiohttp>=3.9
23
+ Requires-Dist: opentelemetry-proto>=1.20
24
+ Requires-Dist: websockets>=13
25
+ Provides-Extra: live
26
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == "live"
27
+ Dynamic: license-file
28
+
29
+ <h1><img src="https://raw.githubusercontent.com/emankhadim/glowtrace/main/docs/logo.png" alt="glowtrace" width="360"></h1>
30
+
31
+ [![PyPI](https://img.shields.io/pypi/v/glowtrace)](https://pypi.org/project/glowtrace/)
32
+ [![Python](https://img.shields.io/pypi/pyversions/glowtrace)](https://pypi.org/project/glowtrace/)
33
+ [![License: MIT](https://img.shields.io/badge/license-MIT-yellow)](https://github.com/emankhadim/glowtrace/blob/main/LICENSE)
34
+
35
+ **See your multi-agent app as a live graph: which agent is running, who it handed work to, and the exact prompt behind every step.**
36
+
37
+ ![glowtrace demo](https://raw.githubusercontent.com/emankhadim/glowtrace/main/docs/demo.gif)
38
+
39
+ When three or four agents start passing work to each other, logs stop being enough. You can't tell which agent is stuck, which tool call failed, or what prompt actually went to the model. glowtrace shows you that while the run is happening.
40
+
41
+ - **Two commands, no code changes** for apps that already export OpenTelemetry traces
42
+ - **Live graph:** agents, LLM calls and tool calls appear as they run; failures turn red
43
+ - **Click any node** for the system prompt, messages, response, tool args and results, tokens and timing
44
+ - **Readable by default:** framework internals like `RunnableSequence` and prompt templates are folded away
45
+ - **Works across frameworks** that use OpenInference, OpenTelemetry GenAI or OpenLLMetry spans (tested end to end with LangGraph so far)
46
+
47
+ It's a debugging view for runs in progress. For stored history, evals and cost tracking, use it next to Phoenix or Langfuse rather than instead of them.
48
+
49
+ ## Install and run
50
+
51
+ ```bash
52
+ pip install glowtrace
53
+ glowtrace serve
54
+ ```
55
+
56
+ The UI is at http://localhost:4318. Port 4318 is the default OTLP/HTTP port, so an app that already exports traces with default settings needs no changes. Otherwise:
57
+
58
+ ```bash
59
+ export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
60
+ export OTEL_BSP_SCHEDULE_DELAY=200 # optional, the default batch delay is 5 s
61
+ ```
62
+
63
+ OTLP exporters only send a span when it ends, so by default a node appears once its step has finished. To see steps while they are still running, add this to your app (needs `pip install "glowtrace[live]"`):
64
+
65
+ ```python
66
+ import glowtrace
67
+ glowtrace.instrument()
68
+ ```
69
+
70
+ ## What it reads
71
+
72
+ glowtrace maps spans that follow any of these conventions:
73
+
74
+ - [OpenInference](https://github.com/Arize-ai/openinference), used by the instrumentors for LangChain/LangGraph, LlamaIndex, CrewAI, the OpenAI Agents SDK and others
75
+ - [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (`gen_ai.*`)
76
+ - [OpenLLMetry](https://github.com/traceloop/openllmetry) (`traceloop.*`)
77
+
78
+ So far I have tested it end to end with LangGraph and with the unmodified [langgraph-supervisor](https://github.com/langchain-ai/langgraph-supervisor-py) quickstart. The other conventions are covered by unit tests, not by real runs. If a framework shows up wrong, an issue with the trace attached helps most.
79
+
80
+ Spans that carry no agent, LLM or tool meaning (HTTP calls, prompt templates, `RunnableSequence` and similar) are folded into their parent so the graph stays readable. `glowtrace serve --all-spans` turns this off.
81
+
82
+ ### LangGraph setup
83
+
84
+ ```python
85
+ from openinference.instrumentation.langchain import LangChainInstrumentor
86
+ from opentelemetry import trace
87
+ from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
88
+ from opentelemetry.sdk.trace import TracerProvider
89
+ from opentelemetry.sdk.trace.export import BatchSpanProcessor
90
+ import glowtrace
91
+
92
+ provider = TracerProvider()
93
+ provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
94
+ trace.set_tracer_provider(provider)
95
+ glowtrace.instrument() # optional
96
+ LangChainInstrumentor().instrument(tracer_provider=provider)
97
+ ```
98
+
99
+ ### Without OpenTelemetry
100
+
101
+ There is a small tracer for plain Python code:
102
+
103
+ ```python
104
+ from glowtrace import Tracer
105
+
106
+ tr = Tracer()
107
+ tr.session("orch", "Orchestrator", input=question)
108
+ with tr.agent("a1", "researcher", parent="orch", system=SYSTEM, input=task) as a:
109
+ with tr.tool("t1", "sql_query", parent="a1", args=sql) as t:
110
+ t.result = run(sql)
111
+ a.output, a.tokens = answer, usage
112
+ ```
113
+
114
+ It sends JSON events over the `/ws` WebSocket, so any language can do the same:
115
+
116
+ | event | fields |
117
+ |---|---|
118
+ | `node` | `id, kind (session/step/agent/llm/tool), parent, title, status, model, system, input, args` |
119
+ | `update` | `id, status (waiting/running/done/error), note, output, result, tokens` |
120
+ | `message` | `from, to, content, label, tokens` |
121
+ | `remove` | `id` (its children move up to its parent) |
122
+
123
+ ## Examples
124
+
125
+ The examples in `examples/` work with any OpenAI-compatible endpoint, including a local model through Ollama. Set `LLM_BASE_URL`, `LLM_API_KEY` and `LLM_MODEL` to point them somewhere else.
126
+
127
+ ```bash
128
+ pip install "glowtrace[live]" openai langgraph langchain-openai langgraph-supervisor \
129
+ openinference-instrumentation-langchain opentelemetry-exporter-otlp-proto-http
130
+ python examples/test_supervisor.py # langgraph-supervisor quickstart
131
+ python examples/langgraph_team.py # small LangGraph team
132
+ python examples/real_agents.py # plain Python agents with the native tracer
133
+ python examples/fake_run.py # scripted events, no LLM
134
+ ```
135
+
136
+ ## Limitations
137
+
138
+ - History is kept in memory only (the last 20,000 events) and is gone when the server stops. glowtrace is not a replacement for Phoenix or Langfuse if you need stored traces, evals or cost tracking.
139
+ - One process, no auth beyond an optional write token (`--token`). Without the token anyone who can reach the port can send data.
140
+ - Large runs with hundreds of nodes get crowded on screen.
141
+
142
+ ## How it works
143
+
144
+ ```
145
+ your app --OTLP/HTTP--> glowtrace serve --WebSocket--> browser
146
+ ```
147
+
148
+ The server accepts protobuf or JSON OTLP, turns spans into graph events, and keeps a history so a tab opened mid-run can catch up. Exporters often send child spans before their parents, so an unknown parent gets a placeholder node that is filled in when its span arrives.
149
+
150
+ The UI is TypeScript without a framework. It builds into one HTML file that ships inside the Python package, so `pip install` does not need Node.
151
+
152
+ ## Development
153
+
154
+ ```bash
155
+ pip install -e ".[live]" pytest && pytest
156
+ cd web && npm install && npm test && npm run build
157
+ ```
158
+
159
+ `glowtrace/` holds the server, the span mapper and the tracer. `web/src/` holds the UI. The built `glowtrace/static/index.html` is committed and CI checks that it matches the source.
160
+
161
+ MIT License
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "glowtrace"
7
- version = "0.3.0"
8
- description = "Watch your AI agents think, live. A zero-config OpenTelemetry receiver that turns agent traces into a live, clickable graph."
7
+ version = "0.3.2"
8
+ description = "See your multi-agent LLM app as a live graph: which agent is running, what it sent, and what came back."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  license = "MIT"
@@ -13,6 +13,10 @@ license-files = ["LICENSE"]
13
13
  authors = [{name = "Eman Khadim"}]
14
14
  classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.9",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
16
20
  "Topic :: Software Development :: Debuggers",
17
21
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
18
22
  "Framework :: AsyncIO",
@@ -20,6 +24,12 @@ classifiers = [
20
24
  keywords = ["agents", "llm", "opentelemetry", "observability", "tracing", "multi-agent", "visualization", "genai"]
21
25
  dependencies = ["aiohttp>=3.9", "opentelemetry-proto>=1.20", "websockets>=13"]
22
26
 
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/emankhadim/glowtrace"
30
+ Source = "https://github.com/emankhadim/glowtrace"
31
+ Issues = "https://github.com/emankhadim/glowtrace/issues"
32
+
23
33
  [project.optional-dependencies]
24
34
  live = ["opentelemetry-sdk>=1.20"]
25
35
 
glowtrace-0.3.0/PKG-INFO DELETED
@@ -1,195 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: glowtrace
3
- Version: 0.3.0
4
- Summary: Watch your AI agents think, live. A zero-config OpenTelemetry receiver that turns agent traces into a live, clickable graph.
5
- Author: Eman Khadim
6
- License-Expression: MIT
7
- Keywords: agents,llm,opentelemetry,observability,tracing,multi-agent,visualization,genai
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Topic :: Software Development :: Debuggers
10
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
11
- Classifier: Framework :: AsyncIO
12
- Requires-Python: >=3.9
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: aiohttp>=3.9
16
- Requires-Dist: opentelemetry-proto>=1.20
17
- Requires-Dist: websockets>=13
18
- Provides-Extra: live
19
- Requires-Dist: opentelemetry-sdk>=1.20; extra == "live"
20
- Dynamic: license-file
21
-
22
- <div align="center">
23
-
24
- # glowtrace
25
-
26
- **Watch your AI agents work, live.**
27
-
28
- A tiny OpenTelemetry receiver that turns agent traces into a live, glowing graph. You see which agent is running, what it's calling, and the exact prompt behind every step.
29
-
30
- ![glowtrace demo](docs/demo.gif)
31
-
32
- [Live demo](https://YOUR-USERNAME.github.io/glowtrace/) · [Quick start](#quick-start) · [Works with](#works-with) · [Compared to](#how-is-this-different) · [How it works](#how-it-works)
33
-
34
- </div>
35
-
36
- ---
37
-
38
- Multi-agent systems get hard to follow once a few agents start handing work to each other. Something goes wrong and you end up scrolling a log. Dashboard tools are good for looking back at a run afterwards, but most of them don't show you the run *while it happens*.
39
-
40
- glowtrace is for that moment. Start it and leave it open on a second screen while your agents run:
41
-
42
- - **Agents, LLM calls and tool calls appear as they start.** The running ones glow, finished ones go quiet, and failures turn red.
43
- - **Messages move along the edges**, so you can see who handed what to whom.
44
- - **Click any node** to see its system prompt, the prompt messages, the completion, tool arguments and results, tokens, timing and the raw span attributes.
45
- - **Framework plumbing is folded away.** `RunnableSequence`, prompt templates, routers and HTTP calls stay hidden, so the graph shows the parts you think about. Use `--all-spans` if you want everything.
46
-
47
- ## How is this different?
48
-
49
- | | glowtrace | LangGraph Studio | Arize Phoenix | agent-flow |
50
- |---|---|---|---|---|
51
- | Animated live graph while the run happens | ✅ | ✅ | trace views | ✅ |
52
- | Works beyond one framework | ✅ any OpenTelemetry source | LangGraph only | ✅ | Claude Code only |
53
- | Zero config for apps that already export OTel | ✅ port 4318 | — | ✅ (agent graph needs extra span attributes) | — |
54
- | Folds framework plumbing into agent → LLM → tool | ✅ automatic | ✅ (graph nodes) | with span metadata | n/a |
55
- | Setup | `pip install` + one command | LangGraph CLI / Agent Server | full platform | VS Code extension |
56
-
57
- glowtrace is not a dashboard, an eval suite or an agent builder. It does one thing: lets you watch agents work, live, and click into any step. If you need stored history, evals and cost analytics, use Phoenix or Langfuse alongside it.
58
-
59
- ## Quick start
60
-
61
- ```bash
62
- pip install glowtrace
63
- glowtrace serve # → http://localhost:4318
64
- ```
65
-
66
- That's it. Port 4318 is OpenTelemetry's default OTLP/HTTP port, so **an app that already exports OTel traces shows up without code changes**. If your exporter points somewhere else, set:
67
-
68
- ```bash
69
- export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
70
- export OTEL_BSP_SCHEDULE_DELAY=200 # optional: send spans quickly instead of every 5s
71
- ```
72
-
73
- ### Make running steps glow, not just finished ones
74
-
75
- Standard exporters only send a span after it ends. One extra line also streams span *starts*:
76
-
77
- ```python
78
- import glowtrace
79
- glowtrace.instrument() # pip install "glowtrace[live]"
80
- ```
81
-
82
- ## Works with
83
-
84
- glowtrace understands the three span conventions agent frameworks emit today:
85
-
86
- | convention | emitted by |
87
- |---|---|
88
- | [OpenInference](https://github.com/Arize-ai/openinference) | instrumentors for LangChain / **LangGraph**, LlamaIndex, CrewAI, OpenAI Agents SDK, smolagents, DSPy, … |
89
- | [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (`gen_ai.*`) | frameworks with native OTel GenAI support, OpenLIT |
90
- | [OpenLLMetry](https://github.com/traceloop/openllmetry) (`traceloop.*`) | Traceloop instrumentors |
91
-
92
- Tested end to end with LangGraph ([`examples/langgraph_team.py`](examples/langgraph_team.py)) and with LangChain's official [langgraph-supervisor](https://github.com/langchain-ai/langgraph-supervisor-py) multi-agent quickstart, unmodified ([`examples/test_supervisor.py`](examples/test_supervisor.py)). The mapping for all three conventions is covered by unit tests. If your framework renders oddly, please open an issue with a trace attached, since that's the fastest way to fix it.
93
-
94
- **LangGraph example:**
95
-
96
- ```python
97
- from openinference.instrumentation.langchain import LangChainInstrumentor
98
- from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
99
- from opentelemetry.sdk.trace import TracerProvider
100
- from opentelemetry.sdk.trace.export import BatchSpanProcessor
101
- from opentelemetry import trace
102
- import glowtrace
103
-
104
- provider = TracerProvider()
105
- provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
106
- trace.set_tracer_provider(provider)
107
- glowtrace.instrument() # optional, for live "running" state
108
- LangChainInstrumentor().instrument(tracer_provider=provider)
109
- # … build and run your graph as usual
110
- ```
111
-
112
- ### Try it without installing anything
113
-
114
- The hosted demo plays a built-in, fictional agent run, and you can drop in any recorded `.jsonl` trace to replay it, slowly or step by step.
115
-
116
- ### No LLM bill needed to try it
117
-
118
- The examples run on any OpenAI-compatible endpoint, including a free local model:
119
-
120
- ```bash
121
- pip install "glowtrace[live]" openai langgraph langchain-openai langgraph-supervisor \
122
- openinference-instrumentation-langchain opentelemetry-exporter-otlp-proto-http
123
- ollama pull qwen2.5:7b
124
- python examples/test_supervisor.py # LangChain's official multi-agent quickstart
125
- python examples/langgraph_team.py # LangGraph team via OpenTelemetry
126
- python examples/real_agents.py # plain-Python agents via glowtrace's own tracer
127
- python examples/fake_run.py # scripted run, no LLM at all
128
- ```
129
-
130
- Groq, Gemini and OpenRouter also have free tiers. Set `LLM_BASE_URL`, `LLM_API_KEY` and `LLM_MODEL` to use one of them.
131
-
132
- ## How it works
133
-
134
- ```
135
- your agents ──OTLP/HTTP (protobuf or JSON)──▶ glowtrace serve ──WebSocket──▶ browser
136
- │
137
- └─ span → graph mapper
138
- ```
139
-
140
- - **Out-of-order spans.** Exporters send children before parents. Unknown parents get a placeholder, shown as running, which is filled in when the real span arrives.
141
- - **Folding.** Spans without AI semantics (HTTP, DB, framework internals) are folded into their parent. A generic LangGraph `agent` node is credited to the named sub-graph that owns it, so you see `researcher`, not `agent`.
142
- - **Late joiners.** A tab opened mid-run receives the history and catches up.
143
- - **Read-only sharing.** `glowtrace serve --token SECRET` means only requests carrying the token can send data. Everyone else can watch.
144
-
145
- The UI is written in TypeScript with no framework, and builds to a single self-contained HTML file that ships inside the Python package. It also runs on its own: open it from GitHub Pages for the demo, or drop in a recorded `.jsonl` trace to replay a run.
146
-
147
- ### Not using OpenTelemetry?
148
-
149
- Use the small native tracer, or send JSON to `/ws` from any language:
150
-
151
- ```python
152
- from glowtrace import Tracer
153
- tr = Tracer()
154
- tr.session("orch", "Orchestrator", input=question)
155
- with tr.agent("a1", "researcher", parent="orch", system=SYSTEM, input=task) as a:
156
- with tr.tool("t1", "sql_query", parent="a1", args=sql) as t:
157
- t.result = run(sql)
158
- a.output, a.tokens = answer, usage
159
- ```
160
-
161
- | event | fields |
162
- |---|---|
163
- | `node` | `id, kind (session/step/agent/llm/tool), parent, title, status, model, system, input, args` |
164
- | `update` | `id, status (waiting/running/done/error), note, output, result, tokens` |
165
- | `message` | `from, to, content, label, tokens` |
166
- | `remove` | `id`: the node's children move up to its parent |
167
-
168
- ## Deploy a public live demo
169
-
170
- The `Dockerfile` runs glowtrace plus a real agent run every few minutes. Deploy it on Hugging Face Spaces (Docker), Render or Railway, and set `LLM_BASE_URL`, `LLM_API_KEY`, `LLM_MODEL` and `GLOWTRACE_TOKEN`. Visitors can watch, but they can't send data or spend your quota.
171
-
172
- ## Development
173
-
174
- ```
175
- glowtrace/ Python: server, OTLP → graph mapper, tracer
176
- web/ TypeScript UI (Vite) → builds into glowtrace/static/index.html
177
- src/store.ts graph state + event handling (no DOM, unit-tested)
178
- src/layout.ts tree layout
179
- src/graph.ts cards, edges, follow-scroll
180
- src/particles.ts message pulses
181
- src/panel.ts activity feed + details panel
182
- src/sources.ts live WebSocket + trace-file parsing
183
- examples/ demo agent teams (agent_loop.py = a tiny hand-written agent, not part of the package)
184
- tests/ Python tests
185
- ```
186
-
187
- ```bash
188
- pip install -e ".[live]" pytest && pytest # backend
189
- cd web && npm install && npm test && npm run build # UI
190
- npm run dev # UI with hot reload; pick "Live" and connect to a running `glowtrace serve`
191
- ```
192
-
193
- The built `glowtrace/static/index.html` is committed so `pip install` needs no Node. CI checks it is up to date.
194
-
195
- MIT licensed.
glowtrace-0.3.0/README.md DELETED
@@ -1,174 +0,0 @@
1
- <div align="center">
2
-
3
- # glowtrace
4
-
5
- **Watch your AI agents work, live.**
6
-
7
- A tiny OpenTelemetry receiver that turns agent traces into a live, glowing graph. You see which agent is running, what it's calling, and the exact prompt behind every step.
8
-
9
- ![glowtrace demo](docs/demo.gif)
10
-
11
- [Live demo](https://YOUR-USERNAME.github.io/glowtrace/) · [Quick start](#quick-start) · [Works with](#works-with) · [Compared to](#how-is-this-different) · [How it works](#how-it-works)
12
-
13
- </div>
14
-
15
- ---
16
-
17
- Multi-agent systems get hard to follow once a few agents start handing work to each other. Something goes wrong and you end up scrolling a log. Dashboard tools are good for looking back at a run afterwards, but most of them don't show you the run *while it happens*.
18
-
19
- glowtrace is for that moment. Start it and leave it open on a second screen while your agents run:
20
-
21
- - **Agents, LLM calls and tool calls appear as they start.** The running ones glow, finished ones go quiet, and failures turn red.
22
- - **Messages move along the edges**, so you can see who handed what to whom.
23
- - **Click any node** to see its system prompt, the prompt messages, the completion, tool arguments and results, tokens, timing and the raw span attributes.
24
- - **Framework plumbing is folded away.** `RunnableSequence`, prompt templates, routers and HTTP calls stay hidden, so the graph shows the parts you think about. Use `--all-spans` if you want everything.
25
-
26
- ## How is this different?
27
-
28
- | | glowtrace | LangGraph Studio | Arize Phoenix | agent-flow |
29
- |---|---|---|---|---|
30
- | Animated live graph while the run happens | ✅ | ✅ | trace views | ✅ |
31
- | Works beyond one framework | ✅ any OpenTelemetry source | LangGraph only | ✅ | Claude Code only |
32
- | Zero config for apps that already export OTel | ✅ port 4318 | — | ✅ (agent graph needs extra span attributes) | — |
33
- | Folds framework plumbing into agent → LLM → tool | ✅ automatic | ✅ (graph nodes) | with span metadata | n/a |
34
- | Setup | `pip install` + one command | LangGraph CLI / Agent Server | full platform | VS Code extension |
35
-
36
- glowtrace is not a dashboard, an eval suite or an agent builder. It does one thing: lets you watch agents work, live, and click into any step. If you need stored history, evals and cost analytics, use Phoenix or Langfuse alongside it.
37
-
38
- ## Quick start
39
-
40
- ```bash
41
- pip install glowtrace
42
- glowtrace serve # → http://localhost:4318
43
- ```
44
-
45
- That's it. Port 4318 is OpenTelemetry's default OTLP/HTTP port, so **an app that already exports OTel traces shows up without code changes**. If your exporter points somewhere else, set:
46
-
47
- ```bash
48
- export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
49
- export OTEL_BSP_SCHEDULE_DELAY=200 # optional: send spans quickly instead of every 5s
50
- ```
51
-
52
- ### Make running steps glow, not just finished ones
53
-
54
- Standard exporters only send a span after it ends. One extra line also streams span *starts*:
55
-
56
- ```python
57
- import glowtrace
58
- glowtrace.instrument() # pip install "glowtrace[live]"
59
- ```
60
-
61
- ## Works with
62
-
63
- glowtrace understands the three span conventions agent frameworks emit today:
64
-
65
- | convention | emitted by |
66
- |---|---|
67
- | [OpenInference](https://github.com/Arize-ai/openinference) | instrumentors for LangChain / **LangGraph**, LlamaIndex, CrewAI, OpenAI Agents SDK, smolagents, DSPy, … |
68
- | [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (`gen_ai.*`) | frameworks with native OTel GenAI support, OpenLIT |
69
- | [OpenLLMetry](https://github.com/traceloop/openllmetry) (`traceloop.*`) | Traceloop instrumentors |
70
-
71
- Tested end to end with LangGraph ([`examples/langgraph_team.py`](examples/langgraph_team.py)) and with LangChain's official [langgraph-supervisor](https://github.com/langchain-ai/langgraph-supervisor-py) multi-agent quickstart, unmodified ([`examples/test_supervisor.py`](examples/test_supervisor.py)). The mapping for all three conventions is covered by unit tests. If your framework renders oddly, please open an issue with a trace attached, since that's the fastest way to fix it.
72
-
73
- **LangGraph example:**
74
-
75
- ```python
76
- from openinference.instrumentation.langchain import LangChainInstrumentor
77
- from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
78
- from opentelemetry.sdk.trace import TracerProvider
79
- from opentelemetry.sdk.trace.export import BatchSpanProcessor
80
- from opentelemetry import trace
81
- import glowtrace
82
-
83
- provider = TracerProvider()
84
- provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
85
- trace.set_tracer_provider(provider)
86
- glowtrace.instrument() # optional, for live "running" state
87
- LangChainInstrumentor().instrument(tracer_provider=provider)
88
- # … build and run your graph as usual
89
- ```
90
-
91
- ### Try it without installing anything
92
-
93
- The hosted demo plays a built-in, fictional agent run, and you can drop in any recorded `.jsonl` trace to replay it, slowly or step by step.
94
-
95
- ### No LLM bill needed to try it
96
-
97
- The examples run on any OpenAI-compatible endpoint, including a free local model:
98
-
99
- ```bash
100
- pip install "glowtrace[live]" openai langgraph langchain-openai langgraph-supervisor \
101
- openinference-instrumentation-langchain opentelemetry-exporter-otlp-proto-http
102
- ollama pull qwen2.5:7b
103
- python examples/test_supervisor.py # LangChain's official multi-agent quickstart
104
- python examples/langgraph_team.py # LangGraph team via OpenTelemetry
105
- python examples/real_agents.py # plain-Python agents via glowtrace's own tracer
106
- python examples/fake_run.py # scripted run, no LLM at all
107
- ```
108
-
109
- Groq, Gemini and OpenRouter also have free tiers. Set `LLM_BASE_URL`, `LLM_API_KEY` and `LLM_MODEL` to use one of them.
110
-
111
- ## How it works
112
-
113
- ```
114
- your agents ──OTLP/HTTP (protobuf or JSON)──▶ glowtrace serve ──WebSocket──▶ browser
115
- │
116
- └─ span → graph mapper
117
- ```
118
-
119
- - **Out-of-order spans.** Exporters send children before parents. Unknown parents get a placeholder, shown as running, which is filled in when the real span arrives.
120
- - **Folding.** Spans without AI semantics (HTTP, DB, framework internals) are folded into their parent. A generic LangGraph `agent` node is credited to the named sub-graph that owns it, so you see `researcher`, not `agent`.
121
- - **Late joiners.** A tab opened mid-run receives the history and catches up.
122
- - **Read-only sharing.** `glowtrace serve --token SECRET` means only requests carrying the token can send data. Everyone else can watch.
123
-
124
- The UI is written in TypeScript with no framework, and builds to a single self-contained HTML file that ships inside the Python package. It also runs on its own: open it from GitHub Pages for the demo, or drop in a recorded `.jsonl` trace to replay a run.
125
-
126
- ### Not using OpenTelemetry?
127
-
128
- Use the small native tracer, or send JSON to `/ws` from any language:
129
-
130
- ```python
131
- from glowtrace import Tracer
132
- tr = Tracer()
133
- tr.session("orch", "Orchestrator", input=question)
134
- with tr.agent("a1", "researcher", parent="orch", system=SYSTEM, input=task) as a:
135
- with tr.tool("t1", "sql_query", parent="a1", args=sql) as t:
136
- t.result = run(sql)
137
- a.output, a.tokens = answer, usage
138
- ```
139
-
140
- | event | fields |
141
- |---|---|
142
- | `node` | `id, kind (session/step/agent/llm/tool), parent, title, status, model, system, input, args` |
143
- | `update` | `id, status (waiting/running/done/error), note, output, result, tokens` |
144
- | `message` | `from, to, content, label, tokens` |
145
- | `remove` | `id`: the node's children move up to its parent |
146
-
147
- ## Deploy a public live demo
148
-
149
- The `Dockerfile` runs glowtrace plus a real agent run every few minutes. Deploy it on Hugging Face Spaces (Docker), Render or Railway, and set `LLM_BASE_URL`, `LLM_API_KEY`, `LLM_MODEL` and `GLOWTRACE_TOKEN`. Visitors can watch, but they can't send data or spend your quota.
150
-
151
- ## Development
152
-
153
- ```
154
- glowtrace/ Python: server, OTLP → graph mapper, tracer
155
- web/ TypeScript UI (Vite) → builds into glowtrace/static/index.html
156
- src/store.ts graph state + event handling (no DOM, unit-tested)
157
- src/layout.ts tree layout
158
- src/graph.ts cards, edges, follow-scroll
159
- src/particles.ts message pulses
160
- src/panel.ts activity feed + details panel
161
- src/sources.ts live WebSocket + trace-file parsing
162
- examples/ demo agent teams (agent_loop.py = a tiny hand-written agent, not part of the package)
163
- tests/ Python tests
164
- ```
165
-
166
- ```bash
167
- pip install -e ".[live]" pytest && pytest # backend
168
- cd web && npm install && npm test && npm run build # UI
169
- npm run dev # UI with hot reload; pick "Live" and connect to a running `glowtrace serve`
170
- ```
171
-
172
- The built `glowtrace/static/index.html` is committed so `pip install` needs no Node. CI checks it is up to date.
173
-
174
- MIT licensed.
@@ -1,195 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: glowtrace
3
- Version: 0.3.0
4
- Summary: Watch your AI agents think, live. A zero-config OpenTelemetry receiver that turns agent traces into a live, clickable graph.
5
- Author: Eman Khadim
6
- License-Expression: MIT
7
- Keywords: agents,llm,opentelemetry,observability,tracing,multi-agent,visualization,genai
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Topic :: Software Development :: Debuggers
10
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
11
- Classifier: Framework :: AsyncIO
12
- Requires-Python: >=3.9
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: aiohttp>=3.9
16
- Requires-Dist: opentelemetry-proto>=1.20
17
- Requires-Dist: websockets>=13
18
- Provides-Extra: live
19
- Requires-Dist: opentelemetry-sdk>=1.20; extra == "live"
20
- Dynamic: license-file
21
-
22
- <div align="center">
23
-
24
- # glowtrace
25
-
26
- **Watch your AI agents work, live.**
27
-
28
- A tiny OpenTelemetry receiver that turns agent traces into a live, glowing graph. You see which agent is running, what it's calling, and the exact prompt behind every step.
29
-
30
- ![glowtrace demo](docs/demo.gif)
31
-
32
- [Live demo](https://YOUR-USERNAME.github.io/glowtrace/) · [Quick start](#quick-start) · [Works with](#works-with) · [Compared to](#how-is-this-different) · [How it works](#how-it-works)
33
-
34
- </div>
35
-
36
- ---
37
-
38
- Multi-agent systems get hard to follow once a few agents start handing work to each other. Something goes wrong and you end up scrolling a log. Dashboard tools are good for looking back at a run afterwards, but most of them don't show you the run *while it happens*.
39
-
40
- glowtrace is for that moment. Start it and leave it open on a second screen while your agents run:
41
-
42
- - **Agents, LLM calls and tool calls appear as they start.** The running ones glow, finished ones go quiet, and failures turn red.
43
- - **Messages move along the edges**, so you can see who handed what to whom.
44
- - **Click any node** to see its system prompt, the prompt messages, the completion, tool arguments and results, tokens, timing and the raw span attributes.
45
- - **Framework plumbing is folded away.** `RunnableSequence`, prompt templates, routers and HTTP calls stay hidden, so the graph shows the parts you think about. Use `--all-spans` if you want everything.
46
-
47
- ## How is this different?
48
-
49
- | | glowtrace | LangGraph Studio | Arize Phoenix | agent-flow |
50
- |---|---|---|---|---|
51
- | Animated live graph while the run happens | ✅ | ✅ | trace views | ✅ |
52
- | Works beyond one framework | ✅ any OpenTelemetry source | LangGraph only | ✅ | Claude Code only |
53
- | Zero config for apps that already export OTel | ✅ port 4318 | — | ✅ (agent graph needs extra span attributes) | — |
54
- | Folds framework plumbing into agent → LLM → tool | ✅ automatic | ✅ (graph nodes) | with span metadata | n/a |
55
- | Setup | `pip install` + one command | LangGraph CLI / Agent Server | full platform | VS Code extension |
56
-
57
- glowtrace is not a dashboard, an eval suite or an agent builder. It does one thing: lets you watch agents work, live, and click into any step. If you need stored history, evals and cost analytics, use Phoenix or Langfuse alongside it.
58
-
59
- ## Quick start
60
-
61
- ```bash
62
- pip install glowtrace
63
- glowtrace serve # → http://localhost:4318
64
- ```
65
-
66
- That's it. Port 4318 is OpenTelemetry's default OTLP/HTTP port, so **an app that already exports OTel traces shows up without code changes**. If your exporter points somewhere else, set:
67
-
68
- ```bash
69
- export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
70
- export OTEL_BSP_SCHEDULE_DELAY=200 # optional: send spans quickly instead of every 5s
71
- ```
72
-
73
- ### Make running steps glow, not just finished ones
74
-
75
- Standard exporters only send a span after it ends. One extra line also streams span *starts*:
76
-
77
- ```python
78
- import glowtrace
79
- glowtrace.instrument() # pip install "glowtrace[live]"
80
- ```
81
-
82
- ## Works with
83
-
84
- glowtrace understands the three span conventions agent frameworks emit today:
85
-
86
- | convention | emitted by |
87
- |---|---|
88
- | [OpenInference](https://github.com/Arize-ai/openinference) | instrumentors for LangChain / **LangGraph**, LlamaIndex, CrewAI, OpenAI Agents SDK, smolagents, DSPy, … |
89
- | [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (`gen_ai.*`) | frameworks with native OTel GenAI support, OpenLIT |
90
- | [OpenLLMetry](https://github.com/traceloop/openllmetry) (`traceloop.*`) | Traceloop instrumentors |
91
-
92
- Tested end to end with LangGraph ([`examples/langgraph_team.py`](examples/langgraph_team.py)) and with LangChain's official [langgraph-supervisor](https://github.com/langchain-ai/langgraph-supervisor-py) multi-agent quickstart, unmodified ([`examples/test_supervisor.py`](examples/test_supervisor.py)). The mapping for all three conventions is covered by unit tests. If your framework renders oddly, please open an issue with a trace attached, since that's the fastest way to fix it.
93
-
94
- **LangGraph example:**
95
-
96
- ```python
97
- from openinference.instrumentation.langchain import LangChainInstrumentor
98
- from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
99
- from opentelemetry.sdk.trace import TracerProvider
100
- from opentelemetry.sdk.trace.export import BatchSpanProcessor
101
- from opentelemetry import trace
102
- import glowtrace
103
-
104
- provider = TracerProvider()
105
- provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
106
- trace.set_tracer_provider(provider)
107
- glowtrace.instrument() # optional, for live "running" state
108
- LangChainInstrumentor().instrument(tracer_provider=provider)
109
- # … build and run your graph as usual
110
- ```
111
-
112
- ### Try it without installing anything
113
-
114
- The hosted demo plays a built-in, fictional agent run, and you can drop in any recorded `.jsonl` trace to replay it, slowly or step by step.
115
-
116
- ### No LLM bill needed to try it
117
-
118
- The examples run on any OpenAI-compatible endpoint, including a free local model:
119
-
120
- ```bash
121
- pip install "glowtrace[live]" openai langgraph langchain-openai langgraph-supervisor \
122
- openinference-instrumentation-langchain opentelemetry-exporter-otlp-proto-http
123
- ollama pull qwen2.5:7b
124
- python examples/test_supervisor.py # LangChain's official multi-agent quickstart
125
- python examples/langgraph_team.py # LangGraph team via OpenTelemetry
126
- python examples/real_agents.py # plain-Python agents via glowtrace's own tracer
127
- python examples/fake_run.py # scripted run, no LLM at all
128
- ```
129
-
130
- Groq, Gemini and OpenRouter also have free tiers. Set `LLM_BASE_URL`, `LLM_API_KEY` and `LLM_MODEL` to use one of them.
131
-
132
- ## How it works
133
-
134
- ```
135
- your agents ──OTLP/HTTP (protobuf or JSON)──▶ glowtrace serve ──WebSocket──▶ browser
136
- │
137
- └─ span → graph mapper
138
- ```
139
-
140
- - **Out-of-order spans.** Exporters send children before parents. Unknown parents get a placeholder, shown as running, which is filled in when the real span arrives.
141
- - **Folding.** Spans without AI semantics (HTTP, DB, framework internals) are folded into their parent. A generic LangGraph `agent` node is credited to the named sub-graph that owns it, so you see `researcher`, not `agent`.
142
- - **Late joiners.** A tab opened mid-run receives the history and catches up.
143
- - **Read-only sharing.** `glowtrace serve --token SECRET` means only requests carrying the token can send data. Everyone else can watch.
144
-
145
- The UI is written in TypeScript with no framework, and builds to a single self-contained HTML file that ships inside the Python package. It also runs on its own: open it from GitHub Pages for the demo, or drop in a recorded `.jsonl` trace to replay a run.
146
-
147
- ### Not using OpenTelemetry?
148
-
149
- Use the small native tracer, or send JSON to `/ws` from any language:
150
-
151
- ```python
152
- from glowtrace import Tracer
153
- tr = Tracer()
154
- tr.session("orch", "Orchestrator", input=question)
155
- with tr.agent("a1", "researcher", parent="orch", system=SYSTEM, input=task) as a:
156
- with tr.tool("t1", "sql_query", parent="a1", args=sql) as t:
157
- t.result = run(sql)
158
- a.output, a.tokens = answer, usage
159
- ```
160
-
161
- | event | fields |
162
- |---|---|
163
- | `node` | `id, kind (session/step/agent/llm/tool), parent, title, status, model, system, input, args` |
164
- | `update` | `id, status (waiting/running/done/error), note, output, result, tokens` |
165
- | `message` | `from, to, content, label, tokens` |
166
- | `remove` | `id`: the node's children move up to its parent |
167
-
168
- ## Deploy a public live demo
169
-
170
- The `Dockerfile` runs glowtrace plus a real agent run every few minutes. Deploy it on Hugging Face Spaces (Docker), Render or Railway, and set `LLM_BASE_URL`, `LLM_API_KEY`, `LLM_MODEL` and `GLOWTRACE_TOKEN`. Visitors can watch, but they can't send data or spend your quota.
171
-
172
- ## Development
173
-
174
- ```
175
- glowtrace/ Python: server, OTLP → graph mapper, tracer
176
- web/ TypeScript UI (Vite) → builds into glowtrace/static/index.html
177
- src/store.ts graph state + event handling (no DOM, unit-tested)
178
- src/layout.ts tree layout
179
- src/graph.ts cards, edges, follow-scroll
180
- src/particles.ts message pulses
181
- src/panel.ts activity feed + details panel
182
- src/sources.ts live WebSocket + trace-file parsing
183
- examples/ demo agent teams (agent_loop.py = a tiny hand-written agent, not part of the package)
184
- tests/ Python tests
185
- ```
186
-
187
- ```bash
188
- pip install -e ".[live]" pytest && pytest # backend
189
- cd web && npm install && npm test && npm run build # UI
190
- npm run dev # UI with hot reload; pick "Live" and connect to a running `glowtrace serve`
191
- ```
192
-
193
- The built `glowtrace/static/index.html` is committed so `pip install` needs no Node. CI checks it is up to date.
194
-
195
- MIT licensed.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes