Skip to content

Commit 1a66c33

Browse files
committed
Rework tracer
1 parent d008cff commit 1a66c33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2760
-3753
lines changed

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# Graphsignal: Observability for AI Stack
1+
# Graphsignal: LLM Performance Analytics
22

33
[![License](http://img.shields.io/github/license/graphsignal/graphsignal-python)](https://github.com/graphsignal/graphsignal-python/blob/main/LICENSE)
44
[![Version](https://img.shields.io/github/v/tag/graphsignal/graphsignal-python?label=version)](https://github.com/graphsignal/graphsignal-python)
55

66

7-
Graphsignal is an observability platform for AI agents and LLM-powered applications. It helps developers ensure AI applications run as expected and users have the best experience. With Graphsignal, developers can:
7+
Graphsignal is an observability platform for AI applications. It helps developers ensure AI applications run efficiently and provide the best user experience. With Graphsignal, developers can:
88

9-
* Trace generations, runs, and sessions with full AI context.
10-
* Score any user interactions and application execution.
11-
* See latency breakdowns and distributions.
12-
* Analyze model API costs for deployments, models, or users.
13-
* Get notified about errors and anomalies.
14-
* Monitor API, compute, and GPU utilization.
9+
* Measure and optimize LLM performance for APIs and hosted models.
10+
* Analyze model API costs for deployments, models, or any custom tags.
11+
* View and search LLM generations with full context.
12+
* Detect errors and monitor APIs, compute, and GPU utilization.
1513

16-
[![Dashboards](https://graphsignal.com/external/screencast-dashboards.gif)](https://graphsignal.com/)
14+
15+
[![Dashboards](https://graphsignal.com/external/screenshot-dashboard.png)](https://graphsignal.com/)
1716

1817
Learn more at [graphsignal.com](https://graphsignal.com).
1918

@@ -56,11 +55,10 @@ Graphsignal **auto-instruments** and traces libraries and frameworks, such as [O
5655

5756
Refer to the guides below for detailed information on:
5857

59-
* [Session Tracking](https://graphsignal.com/docs/guides/session-tracking/)
60-
* [User Tracking](https://graphsignal.com/docs/guides/user-tracking/)
6158
* [Manual Tracing](https://graphsignal.com/docs/guides/manual-tracing/)
62-
* [Scores and Feedback](https://graphsignal.com/docs/guides/scores-and-feedback/)
59+
* [Session Tracking](https://graphsignal.com/docs/guides/session-tracking/)
6360
* [Cost and Usage Monitoring](https://graphsignal.com/docs/guides/cost-and-usage-monitoring/)
61+
* [Scores and Feedback](https://graphsignal.com/docs/guides/scores-and-feedback/)
6462

6563
See [API reference](https://graphsignal.com/docs/reference/python-api/) for full documentation.
6664

@@ -69,7 +67,7 @@ Some integration examples are available in [examples](https://github.com/graphsi
6967

7068
## Analyze
7169

72-
[Log in](https://app.graphsignal.com/) to Graphsignal to monitor and analyze your application and monitor for issues.
70+
[Log in](https://app.graphsignal.com/) to Graphsignal to monitor and analyze your application.
7371

7472

7573
## Overhead

graphsignal/__init__.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,26 @@ def get_tag(key: str) -> Optional[str]:
9999
return _tracer.get_tag(key)
100100

101101

102-
def set_context_tag(key: str, value: str) -> None:
102+
def remove_tag(key: str):
103103
_check_configured()
104-
_tracer.set_context_tag(key, value)
104+
return _tracer.remove_tag(key)
105+
106+
107+
def set_context_tag(key: str, value: str, append_uuid=None) -> None:
108+
_check_configured()
109+
_tracer.set_context_tag(key, value, append_uuid=append_uuid)
105110

106111

107112
def get_context_tag(key: str) -> Optional[str]:
108113
_check_configured()
109114
return _tracer.get_context_tag(key)
110115

111116

117+
def remove_context_tag(key: str):
118+
_check_configured()
119+
return _tracer.remove_context_tag(key)
120+
121+
112122
def trace(
113123
operation: str,
114124
tags: Optional[Dict[str, str]] = None) -> 'Span':
@@ -117,12 +127,6 @@ def trace(
117127
return _tracer.trace(operation=operation, tags=tags)
118128

119129

120-
def start_trace(
121-
operation: str,
122-
tags: Optional[Dict[str, str]] = None) -> 'Span':
123-
trace(operation, tags)
124-
125-
126130
def trace_function(
127131
func=None,
128132
*,
@@ -131,12 +135,6 @@ def trace_function(
131135
return _tracer.trace_function(func, operation=operation, tags=tags)
132136

133137

134-
def current_span() -> Optional['Span']:
135-
_check_configured()
136-
137-
return _tracer.current_span()
138-
139-
140138
def score(
141139
name: str,
142140
tags: Optional[Dict[str, str]] = None,
@@ -177,10 +175,14 @@ def shutdown() -> None:
177175
'configure',
178176
'upload',
179177
'shutdown',
180-
'start_trace',
181178
'trace',
182179
'function_trace',
183180
'Span',
184181
'score',
182+
'set_tag',
183+
'get_tag',
184+
'set_context_tag',
185+
'get_context_tag',
186+
'remove_context_tag',
185187
'callbacks'
186188
]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from graphsignal.callbacks.langchain.v2 import GraphsignalCallbackHandler
2-
from graphsignal.callbacks.langchain.v2 import GraphsignalAsyncCallbackHandler
1+
from graphsignal.callbacks.langchain.v1 import GraphsignalCallbackHandler
2+
from graphsignal.callbacks.langchain.v1 import GraphsignalAsyncCallbackHandler

0 commit comments

Comments
 (0)