agenta 0.27.0a2__py3-none-any.whl → 0.27.0a6__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 agenta might be problematic. Click here for more details.
- agenta/sdk/decorators/routing.py +126 -130
- agenta/sdk/decorators/tracing.py +198 -244
- agenta/sdk/tracing/attributes.py +7 -2
- agenta/sdk/tracing/context.py +5 -2
- agenta/sdk/tracing/conventions.py +10 -8
- agenta/sdk/tracing/exporters.py +5 -5
- agenta/sdk/tracing/inline.py +16 -87
- agenta/sdk/tracing/processors.py +21 -7
- agenta/sdk/tracing/spans.py +16 -4
- agenta/sdk/tracing/tracing.py +58 -30
- {agenta-0.27.0a2.dist-info → agenta-0.27.0a6.dist-info}/METADATA +1 -1
- {agenta-0.27.0a2.dist-info → agenta-0.27.0a6.dist-info}/RECORD +14 -14
- {agenta-0.27.0a2.dist-info → agenta-0.27.0a6.dist-info}/WHEEL +0 -0
- {agenta-0.27.0a2.dist-info → agenta-0.27.0a6.dist-info}/entry_points.txt +0 -0
agenta/sdk/tracing/inline.py
CHANGED
|
@@ -11,82 +11,11 @@ from enum import Enum
|
|
|
11
11
|
from collections import OrderedDict
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _p_id(id):
|
|
18
|
-
return repr(str(id)[:NOF_CHARS])
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _p_osa(o):
|
|
22
|
-
elements = []
|
|
23
|
-
|
|
24
|
-
for i in OrderedDict(sorted(o.items())).items():
|
|
25
|
-
if not i[0].startswith("_"):
|
|
26
|
-
if i[1].__class__.__module__ != "builtins":
|
|
27
|
-
if repr(i[1]).startswith("<"):
|
|
28
|
-
elements.append(f"{i[0]}: {i[1].name}")
|
|
29
|
-
elif repr(i[1]).startswith("UUID("):
|
|
30
|
-
elements.append(f"{i[0]}: {_p_id(i[1])}")
|
|
31
|
-
else:
|
|
32
|
-
elements.append(f"{i[0]}: {i[1].__str__()}")
|
|
33
|
-
else:
|
|
34
|
-
if isinstance(i[1], list):
|
|
35
|
-
elements.append(
|
|
36
|
-
f"{i[0]}: [" + ", ".join([el.__str__() for el in i[1]]) + "]"
|
|
37
|
-
)
|
|
38
|
-
elif isinstance(i[1], dict):
|
|
39
|
-
elements.append(f"{i[0]}: {{{_p_osa(i[1])}}}")
|
|
40
|
-
else:
|
|
41
|
-
if i[1] is not None:
|
|
42
|
-
if i[0] == "slug":
|
|
43
|
-
elements.append(f"{i[0]}: {repr(i[1][:8])}")
|
|
44
|
-
else:
|
|
45
|
-
elements.append(f"{i[0]}: {repr(i[1])}")
|
|
46
|
-
|
|
47
|
-
return ", ".join(elements)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def _p_ora(o, open="{", close="}", sep=": ", foo=repr):
|
|
51
|
-
if o.__class__.__module__ != "builtins":
|
|
52
|
-
if o.__class__.__name__ == "UUID":
|
|
53
|
-
return repr(o)
|
|
54
|
-
if isinstance(o, Enum):
|
|
55
|
-
return o
|
|
56
|
-
if isinstance(o, datetime):
|
|
57
|
-
return o.isoformat()
|
|
58
|
-
return f"{o.__class__.__name__}({_p_ora(o.__dict__, open='', close='', sep='=', foo=lambda x : x)})"
|
|
59
|
-
elif isinstance(o, list):
|
|
60
|
-
return f"[{', '.join([repr(el) for el in o])}]"
|
|
61
|
-
elif isinstance(o, dict):
|
|
62
|
-
o = OrderedDict(sorted(o.items()))
|
|
63
|
-
return f"{open}{', '.join([f'{foo(elk)}{sep}{_p_ora(elv)}' for elk, elv in o.items()])}{close}"
|
|
64
|
-
else:
|
|
65
|
-
if o is not None:
|
|
66
|
-
return repr(o)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def _str(o):
|
|
70
|
-
return f"{{{_p_osa(o.__dict__)}}}"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def _repr(o):
|
|
74
|
-
return _p_ora(o)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class DisplayBase(BaseModel):
|
|
78
|
-
def __str__(self):
|
|
79
|
-
return _str(self)
|
|
80
|
-
|
|
81
|
-
def __repr__(self):
|
|
82
|
-
return _repr(self)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class ProjectScopeDTO(DisplayBase):
|
|
14
|
+
class ProjectScopeDTO(BaseModel):
|
|
86
15
|
project_id: UUID
|
|
87
16
|
|
|
88
17
|
|
|
89
|
-
class LifecycleDTO(
|
|
18
|
+
class LifecycleDTO(BaseModel):
|
|
90
19
|
created_at: datetime
|
|
91
20
|
updated_at: Optional[datetime] = None
|
|
92
21
|
|
|
@@ -102,14 +31,14 @@ class LifecycleDTO(DisplayBase):
|
|
|
102
31
|
### services.observability.dtos ###
|
|
103
32
|
### --------------------------- ###
|
|
104
33
|
|
|
105
|
-
from typing import List, Dict, Any, Union, Optional
|
|
34
|
+
from typing import List, Dict, Any, Union, Optional
|
|
106
35
|
|
|
107
36
|
from enum import Enum
|
|
108
37
|
from datetime import datetime
|
|
109
38
|
from uuid import UUID
|
|
110
39
|
|
|
111
40
|
|
|
112
|
-
class TimeDTO(
|
|
41
|
+
class TimeDTO(BaseModel):
|
|
113
42
|
start: datetime
|
|
114
43
|
end: datetime
|
|
115
44
|
span: int
|
|
@@ -121,7 +50,7 @@ class StatusCode(Enum):
|
|
|
121
50
|
ERROR = "ERROR"
|
|
122
51
|
|
|
123
52
|
|
|
124
|
-
class StatusDTO(
|
|
53
|
+
class StatusDTO(BaseModel):
|
|
125
54
|
code: StatusCode
|
|
126
55
|
message: Optional[str] = None
|
|
127
56
|
stacktrace: Optional[str] = None
|
|
@@ -155,16 +84,16 @@ class NodeType(Enum):
|
|
|
155
84
|
# --- VARIANTS --- #
|
|
156
85
|
|
|
157
86
|
|
|
158
|
-
class RootDTO(
|
|
87
|
+
class RootDTO(BaseModel):
|
|
159
88
|
id: UUID
|
|
160
89
|
|
|
161
90
|
|
|
162
|
-
class TreeDTO(
|
|
91
|
+
class TreeDTO(BaseModel):
|
|
163
92
|
id: UUID
|
|
164
93
|
type: Optional[TreeType] = None
|
|
165
94
|
|
|
166
95
|
|
|
167
|
-
class NodeDTO(
|
|
96
|
+
class NodeDTO(BaseModel):
|
|
168
97
|
id: UUID
|
|
169
98
|
type: Optional[NodeType] = None
|
|
170
99
|
name: str
|
|
@@ -177,13 +106,13 @@ Tags = Dict[str, str]
|
|
|
177
106
|
Refs = Dict[str, str]
|
|
178
107
|
|
|
179
108
|
|
|
180
|
-
class LinkDTO(
|
|
109
|
+
class LinkDTO(BaseModel):
|
|
181
110
|
type: str
|
|
182
111
|
id: UUID
|
|
183
112
|
tree_id: Optional[UUID] = None
|
|
184
113
|
|
|
185
114
|
|
|
186
|
-
class ParentDTO(
|
|
115
|
+
class ParentDTO(BaseModel):
|
|
187
116
|
id: UUID
|
|
188
117
|
|
|
189
118
|
|
|
@@ -205,25 +134,25 @@ class OTelStatusCode(Enum):
|
|
|
205
134
|
STATUS_CODE_UNSET = "STATUS_CODE_UNSET"
|
|
206
135
|
|
|
207
136
|
|
|
208
|
-
class OTelContextDTO(
|
|
137
|
+
class OTelContextDTO(BaseModel):
|
|
209
138
|
trace_id: str
|
|
210
139
|
span_id: str
|
|
211
140
|
|
|
212
141
|
|
|
213
|
-
class OTelEventDTO(
|
|
142
|
+
class OTelEventDTO(BaseModel):
|
|
214
143
|
name: str
|
|
215
144
|
timestamp: datetime
|
|
216
145
|
|
|
217
146
|
attributes: Optional[Attributes] = None
|
|
218
147
|
|
|
219
148
|
|
|
220
|
-
class OTelLinkDTO(
|
|
149
|
+
class OTelLinkDTO(BaseModel):
|
|
221
150
|
context: OTelContextDTO
|
|
222
151
|
|
|
223
152
|
attributes: Optional[Attributes] = None
|
|
224
153
|
|
|
225
154
|
|
|
226
|
-
class OTelExtraDTO(
|
|
155
|
+
class OTelExtraDTO(BaseModel):
|
|
227
156
|
kind: Optional[str] = None
|
|
228
157
|
|
|
229
158
|
attributes: Optional[Attributes] = None
|
|
@@ -231,7 +160,7 @@ class OTelExtraDTO(DisplayBase):
|
|
|
231
160
|
links: Optional[List[OTelLinkDTO]] = None
|
|
232
161
|
|
|
233
162
|
|
|
234
|
-
class SpanDTO(
|
|
163
|
+
class SpanDTO(BaseModel):
|
|
235
164
|
scope: ProjectScopeDTO
|
|
236
165
|
|
|
237
166
|
lifecycle: Optional[LifecycleDTO] = None
|
|
@@ -258,7 +187,7 @@ class SpanDTO(DisplayBase):
|
|
|
258
187
|
nodes: Optional[Dict[str, Union["SpanDTO", List["SpanDTO"]]]] = None
|
|
259
188
|
|
|
260
189
|
|
|
261
|
-
class OTelSpanDTO(
|
|
190
|
+
class OTelSpanDTO(BaseModel):
|
|
262
191
|
context: OTelContextDTO
|
|
263
192
|
|
|
264
193
|
name: str
|
agenta/sdk/tracing/processors.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from typing import Optional, Dict
|
|
2
|
-
from traceback import format_exc
|
|
3
2
|
|
|
4
3
|
from opentelemetry.context import Context
|
|
5
4
|
from opentelemetry.sdk.trace import Span
|
|
@@ -7,7 +6,6 @@ from opentelemetry.sdk.trace.export import (
|
|
|
7
6
|
SpanExporter,
|
|
8
7
|
ReadableSpan,
|
|
9
8
|
BatchSpanProcessor,
|
|
10
|
-
_DEFAULT_EXPORT_TIMEOUT_MILLIS,
|
|
11
9
|
_DEFAULT_MAX_QUEUE_SIZE,
|
|
12
10
|
)
|
|
13
11
|
|
|
@@ -38,7 +36,11 @@ class TraceProcessor(BatchSpanProcessor):
|
|
|
38
36
|
self._exporter = span_exporter
|
|
39
37
|
self.references = references or dict()
|
|
40
38
|
|
|
41
|
-
def on_start(
|
|
39
|
+
def on_start(
|
|
40
|
+
self,
|
|
41
|
+
span: Span,
|
|
42
|
+
parent_context: Optional[Context] = None,
|
|
43
|
+
) -> None:
|
|
42
44
|
# ADD LINKS FROM CONTEXT, HERE
|
|
43
45
|
|
|
44
46
|
for key in self.references.keys():
|
|
@@ -49,7 +51,10 @@ class TraceProcessor(BatchSpanProcessor):
|
|
|
49
51
|
|
|
50
52
|
self._registry[span.context.trace_id][span.context.span_id] = True
|
|
51
53
|
|
|
52
|
-
def on_end(
|
|
54
|
+
def on_end(
|
|
55
|
+
self,
|
|
56
|
+
span: ReadableSpan,
|
|
57
|
+
):
|
|
53
58
|
super().on_end(span)
|
|
54
59
|
|
|
55
60
|
del self._registry[span.context.trace_id][span.context.span_id]
|
|
@@ -57,7 +62,10 @@ class TraceProcessor(BatchSpanProcessor):
|
|
|
57
62
|
if self.is_ready(span.get_span_context().trace_id):
|
|
58
63
|
self.force_flush()
|
|
59
64
|
|
|
60
|
-
def force_flush(
|
|
65
|
+
def force_flush(
|
|
66
|
+
self,
|
|
67
|
+
timeout_millis: int = None,
|
|
68
|
+
) -> bool:
|
|
61
69
|
ret = super().force_flush(timeout_millis)
|
|
62
70
|
|
|
63
71
|
if not ret:
|
|
@@ -65,12 +73,18 @@ class TraceProcessor(BatchSpanProcessor):
|
|
|
65
73
|
log.error("Agenta SDK - skipping export due to timeout.")
|
|
66
74
|
log.error("--------------------------------------------")
|
|
67
75
|
|
|
68
|
-
def is_ready(
|
|
76
|
+
def is_ready(
|
|
77
|
+
self,
|
|
78
|
+
trace_id: Optional[int] = None,
|
|
79
|
+
) -> bool:
|
|
69
80
|
is_ready = not len(self._registry.get(trace_id, {}))
|
|
70
81
|
|
|
71
82
|
return is_ready
|
|
72
83
|
|
|
73
|
-
def fetch(
|
|
84
|
+
def fetch(
|
|
85
|
+
self,
|
|
86
|
+
trace_id: Optional[int] = None,
|
|
87
|
+
) -> Dict[str, ReadableSpan]:
|
|
74
88
|
trace = self._exporter.fetch(trace_id) # type: ignore
|
|
75
89
|
|
|
76
90
|
return trace
|
agenta/sdk/tracing/spans.py
CHANGED
|
@@ -8,7 +8,10 @@ from agenta.sdk.tracing.attributes import serialize
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class CustomSpan(Span): # INHERITANCE FOR TYPING ONLY
|
|
11
|
-
def __init__(
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
span: Span,
|
|
14
|
+
) -> None:
|
|
12
15
|
super().__init__( # INHERITANCE FOR TYPING ONLY
|
|
13
16
|
name=span.name,
|
|
14
17
|
context=span.context,
|
|
@@ -38,7 +41,10 @@ class CustomSpan(Span): # INHERITANCE FOR TYPING ONLY
|
|
|
38
41
|
def is_recording(self) -> bool:
|
|
39
42
|
return self._span.is_recording()
|
|
40
43
|
|
|
41
|
-
def update_name(
|
|
44
|
+
def update_name(
|
|
45
|
+
self,
|
|
46
|
+
name: str,
|
|
47
|
+
) -> None:
|
|
42
48
|
self._span.update_name(name)
|
|
43
49
|
|
|
44
50
|
def set_status(
|
|
@@ -46,7 +52,10 @@ class CustomSpan(Span): # INHERITANCE FOR TYPING ONLY
|
|
|
46
52
|
status: Union[Status, StatusCode],
|
|
47
53
|
description: Optional[str] = None,
|
|
48
54
|
) -> None:
|
|
49
|
-
self._span.set_status(
|
|
55
|
+
self._span.set_status(
|
|
56
|
+
status=status,
|
|
57
|
+
description=description,
|
|
58
|
+
)
|
|
50
59
|
|
|
51
60
|
def end(self) -> None:
|
|
52
61
|
self._span.end()
|
|
@@ -73,7 +82,10 @@ class CustomSpan(Span): # INHERITANCE FOR TYPING ONLY
|
|
|
73
82
|
value: Any,
|
|
74
83
|
namespace: Optional[str] = None,
|
|
75
84
|
) -> None:
|
|
76
|
-
self.set_attributes(
|
|
85
|
+
self.set_attributes(
|
|
86
|
+
attributes={key: value},
|
|
87
|
+
namespace=namespace,
|
|
88
|
+
)
|
|
77
89
|
|
|
78
90
|
def add_event(
|
|
79
91
|
self,
|
agenta/sdk/tracing/tracing.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
from typing import Optional, Any, Dict
|
|
2
2
|
from enum import Enum
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
# from traceback import format_exc
|
|
3
6
|
|
|
4
7
|
from httpx import get as check
|
|
5
8
|
|
|
@@ -16,12 +19,10 @@ from opentelemetry.sdk.resources import Resource
|
|
|
16
19
|
from agenta.sdk.utils.singleton import Singleton
|
|
17
20
|
from agenta.sdk.utils.exceptions import suppress
|
|
18
21
|
from agenta.sdk.utils.logging import log
|
|
19
|
-
|
|
20
22
|
from agenta.sdk.tracing.processors import TraceProcessor
|
|
21
|
-
from agenta.sdk.tracing.exporters import
|
|
23
|
+
from agenta.sdk.tracing.exporters import InlineExporter, OTLPExporter
|
|
22
24
|
from agenta.sdk.tracing.spans import CustomSpan
|
|
23
25
|
from agenta.sdk.tracing.inline import parse_inline_trace
|
|
24
|
-
|
|
25
26
|
from agenta.sdk.tracing.conventions import Reference, is_valid_attribute_key
|
|
26
27
|
|
|
27
28
|
|
|
@@ -59,7 +60,7 @@ class Tracing(metaclass=Singleton):
|
|
|
59
60
|
self,
|
|
60
61
|
project_id: Optional[str] = None,
|
|
61
62
|
api_key: Optional[str] = None,
|
|
62
|
-
#
|
|
63
|
+
# DEPRECATING
|
|
63
64
|
app_id: Optional[str] = None,
|
|
64
65
|
):
|
|
65
66
|
# AUTHENTICATION (OTLP)
|
|
@@ -75,53 +76,59 @@ class Tracing(metaclass=Singleton):
|
|
|
75
76
|
self.headers.update(**{"AG-APP-ID": app_id})
|
|
76
77
|
if api_key:
|
|
77
78
|
self.headers.update(**{"Authorization": self.api_key})
|
|
79
|
+
|
|
78
80
|
# REFERENCES
|
|
79
|
-
self.references
|
|
81
|
+
self.references["application.id"] = app_id
|
|
80
82
|
|
|
81
83
|
# TRACER PROVIDER
|
|
82
84
|
self.tracer_provider = TracerProvider(
|
|
83
85
|
resource=Resource(attributes={"service.name": "agenta-sdk"})
|
|
84
86
|
)
|
|
85
|
-
# TRACE PROCESSORS -- CONSOLE
|
|
86
|
-
# _console = TraceProcessor(
|
|
87
|
-
# ConsoleExporter(),
|
|
88
|
-
# references=self.references,
|
|
89
|
-
# )
|
|
90
|
-
# self.tracer_provider.add_span_processor(_console)
|
|
91
87
|
# TRACE PROCESSORS -- INLINE
|
|
92
88
|
self.inline = TraceProcessor(
|
|
93
|
-
InlineExporter(
|
|
89
|
+
InlineExporter(
|
|
90
|
+
registry=self.inline_spans,
|
|
91
|
+
),
|
|
94
92
|
references=self.references,
|
|
95
93
|
)
|
|
96
94
|
self.tracer_provider.add_span_processor(self.inline)
|
|
97
95
|
# TRACE PROCESSORS -- OTLP
|
|
98
96
|
try:
|
|
99
|
-
log.info(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
log.info("--------------------------------------------")
|
|
98
|
+
log.info(f"Agenta SDK - connecting to otlp receiver at: {self.otlp_url}")
|
|
99
|
+
log.info("--------------------------------------------")
|
|
100
|
+
|
|
101
|
+
check(
|
|
102
|
+
self.otlp_url,
|
|
103
|
+
headers=self.headers,
|
|
104
|
+
timeout=1,
|
|
105
|
+
)
|
|
104
106
|
|
|
105
107
|
_otlp = TraceProcessor(
|
|
106
|
-
OTLPExporter(
|
|
108
|
+
OTLPExporter(
|
|
109
|
+
endpoint=self.otlp_url,
|
|
110
|
+
headers=self.headers,
|
|
111
|
+
),
|
|
107
112
|
references=self.references,
|
|
108
113
|
)
|
|
109
114
|
|
|
110
115
|
self.tracer_provider.add_span_processor(_otlp)
|
|
111
|
-
|
|
112
|
-
log.
|
|
113
|
-
log.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
)
|
|
116
|
+
|
|
117
|
+
log.info(f"Success: traces will be exported.")
|
|
118
|
+
log.info("--------------------------------------------")
|
|
119
|
+
|
|
120
|
+
except:
|
|
121
|
+
# log.warning(format_exc().strip("\n"))
|
|
122
|
+
# log.warning("--------------------------------------------")
|
|
123
|
+
log.warning(f"Failure: traces will not be exported.")
|
|
124
|
+
log.warning("--------------------------------------------")
|
|
125
|
+
|
|
117
126
|
# GLOBAL TRACER PROVIDER -- INSTRUMENTATION LIBRARIES
|
|
118
127
|
set_tracer_provider(self.tracer_provider)
|
|
119
128
|
# TRACER
|
|
120
129
|
self.tracer: Tracer = self.tracer_provider.get_tracer("agenta.tracer")
|
|
121
130
|
|
|
122
|
-
def get_current_span(
|
|
123
|
-
self,
|
|
124
|
-
):
|
|
131
|
+
def get_current_span(self):
|
|
125
132
|
_span = None
|
|
126
133
|
|
|
127
134
|
with suppress():
|
|
@@ -141,7 +148,10 @@ class Tracing(metaclass=Singleton):
|
|
|
141
148
|
if span is None:
|
|
142
149
|
span = self.get_current_span()
|
|
143
150
|
|
|
144
|
-
span.set_attributes(
|
|
151
|
+
span.set_attributes(
|
|
152
|
+
attributes={"internals": attributes},
|
|
153
|
+
namespace="data",
|
|
154
|
+
)
|
|
145
155
|
|
|
146
156
|
def store_refs(
|
|
147
157
|
self,
|
|
@@ -154,12 +164,22 @@ class Tracing(metaclass=Singleton):
|
|
|
154
164
|
|
|
155
165
|
for key in refs.keys():
|
|
156
166
|
if key in Reference:
|
|
167
|
+
# TYPE AND FORMAT CHECKING
|
|
168
|
+
if key.endswith(".id"):
|
|
169
|
+
try:
|
|
170
|
+
refs[key] = str(UUID(refs[key]))
|
|
171
|
+
except:
|
|
172
|
+
refs[key] = None
|
|
173
|
+
|
|
174
|
+
refs[key] = str(refs[key])
|
|
175
|
+
|
|
157
176
|
# ADD REFERENCE TO THIS SPAN
|
|
158
177
|
span.set_attribute(
|
|
159
178
|
key.value if isinstance(key, Enum) else key,
|
|
160
179
|
refs[key],
|
|
161
180
|
namespace="refs",
|
|
162
181
|
)
|
|
182
|
+
|
|
163
183
|
# AND TO ALL SPANS CREATED AFTER THIS ONE
|
|
164
184
|
self.references[key] = refs[key]
|
|
165
185
|
# TODO: THIS SHOULD BE REPLACED BY A TRACE CONTEXT !!!
|
|
@@ -175,7 +195,11 @@ class Tracing(metaclass=Singleton):
|
|
|
175
195
|
|
|
176
196
|
for key in meta.keys():
|
|
177
197
|
if is_valid_attribute_key(key):
|
|
178
|
-
span.set_attribute(
|
|
198
|
+
span.set_attribute(
|
|
199
|
+
key,
|
|
200
|
+
meta[key],
|
|
201
|
+
namespace="meta",
|
|
202
|
+
)
|
|
179
203
|
|
|
180
204
|
def store_metrics(
|
|
181
205
|
self,
|
|
@@ -188,7 +212,11 @@ class Tracing(metaclass=Singleton):
|
|
|
188
212
|
|
|
189
213
|
for key in metrics.keys():
|
|
190
214
|
if is_valid_attribute_key(key):
|
|
191
|
-
span.set_attribute(
|
|
215
|
+
span.set_attribute(
|
|
216
|
+
key,
|
|
217
|
+
metrics[key],
|
|
218
|
+
namespace="metrics",
|
|
219
|
+
)
|
|
192
220
|
|
|
193
221
|
def is_inline_trace_ready(
|
|
194
222
|
self,
|
|
@@ -141,20 +141,20 @@ agenta/sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
141
141
|
agenta/sdk/context/routing.py,sha256=gOoOM88hSjIjzQ3ni68TjUoq7WtwSH3kB07YjCYvW2c,631
|
|
142
142
|
agenta/sdk/context/tracing.py,sha256=UmmW15UFFsvxS0myS6aD9wBk5iNepNlQi4tEQ_ejfYM,96
|
|
143
143
|
agenta/sdk/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
144
|
-
agenta/sdk/decorators/routing.py,sha256=
|
|
145
|
-
agenta/sdk/decorators/tracing.py,sha256
|
|
144
|
+
agenta/sdk/decorators/routing.py,sha256=ERtZDJoCoR_s73gOt0h_Z_Kr8FCskMkrl_ILD85VV04,35873
|
|
145
|
+
agenta/sdk/decorators/tracing.py,sha256=iXcQKoQ3VcV-FBOSUJ6UXChGaYkOQf20VMrfkfme0LI,7564
|
|
146
146
|
agenta/sdk/litellm/__init__.py,sha256=Bpz1gfHQc0MN1yolWcjifLWznv6GjHggvRGQSpxpihM,37
|
|
147
147
|
agenta/sdk/litellm/litellm.py,sha256=j4WyRTQdxLkvelaPm5BfUbaUxkbQXDhyr3yp9yXo1RQ,8289
|
|
148
148
|
agenta/sdk/router.py,sha256=mOguvtOwl2wmyAgOuWTsf98pQwpNiUILKIo67W_hR3A,119
|
|
149
149
|
agenta/sdk/tracing/__init__.py,sha256=rQNe5-zT5Kt7_CDhq-lnUIi1EYTBVzVf_MbfcIxVD98,41
|
|
150
|
-
agenta/sdk/tracing/attributes.py,sha256=
|
|
151
|
-
agenta/sdk/tracing/context.py,sha256=
|
|
152
|
-
agenta/sdk/tracing/conventions.py,sha256=
|
|
153
|
-
agenta/sdk/tracing/exporters.py,sha256=
|
|
154
|
-
agenta/sdk/tracing/inline.py,sha256=
|
|
155
|
-
agenta/sdk/tracing/processors.py,sha256=
|
|
156
|
-
agenta/sdk/tracing/spans.py,sha256=
|
|
157
|
-
agenta/sdk/tracing/tracing.py,sha256=
|
|
150
|
+
agenta/sdk/tracing/attributes.py,sha256=zh8JQZSeYCLBeIRSopKJx6QQ-WEgw08Cr64DS_WOcT8,3833
|
|
151
|
+
agenta/sdk/tracing/context.py,sha256=PSJdhcaOXSMAuGUBySpLKPKyx8duF3TJzhUEk2ufqPc,777
|
|
152
|
+
agenta/sdk/tracing/conventions.py,sha256=JBtznBXZ3aRkGKkLl7cPwdMNh3w1G-H2Ta2YrAxbr38,950
|
|
153
|
+
agenta/sdk/tracing/exporters.py,sha256=LzNGjOARwRrJ5gTFjdG9ziZlqnA0WeMjpkUfpsl8BSs,1383
|
|
154
|
+
agenta/sdk/tracing/inline.py,sha256=imtlQ0rqfX1rD-SYo1YVAZCctRjxZskdfeA1Pm__wcw,32980
|
|
155
|
+
agenta/sdk/tracing/processors.py,sha256=uqH8AKdRJkv-MY5FcTD-Qrrr0ARMlAAsImPPKolteQ0,2444
|
|
156
|
+
agenta/sdk/tracing/spans.py,sha256=nqUOjjirBxB8Eacv8Qj4Ra_6rknGi3lbJdNyKmk5ODQ,3707
|
|
157
|
+
agenta/sdk/tracing/tracing.py,sha256=g8LKWOLdeEM6HifrmZAdVYi31-sNFAamioaVwUQ-qrs,7712
|
|
158
158
|
agenta/sdk/types.py,sha256=B7C7Jpeq0CpmLwmN1dmpggJsZX8WpxyyM42PkdSsx3s,5669
|
|
159
159
|
agenta/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
160
160
|
agenta/sdk/utils/costs.py,sha256=i8C7ud__pThLS55XkN4YW8czXtGeXr2mx7jjcOFeiXg,5955
|
|
@@ -179,7 +179,7 @@ agenta/templates/simple_prompt/app.py,sha256=kODgF6lhzsaJPdgL5b21bUki6jkvqjWZzWR
|
|
|
179
179
|
agenta/templates/simple_prompt/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
|
|
180
180
|
agenta/templates/simple_prompt/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
|
|
181
181
|
agenta/templates/simple_prompt/template.toml,sha256=DQBtRrF4GU8LBEXOZ-GGuINXMQDKGTEG5y37tnvIUIE,60
|
|
182
|
-
agenta-0.27.
|
|
183
|
-
agenta-0.27.
|
|
184
|
-
agenta-0.27.
|
|
185
|
-
agenta-0.27.
|
|
182
|
+
agenta-0.27.0a6.dist-info/METADATA,sha256=P8n7lccwkGHLB_YYeKmr_mpCr41oqW4eC_QRJC8PrXs,31738
|
|
183
|
+
agenta-0.27.0a6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
184
|
+
agenta-0.27.0a6.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
|
|
185
|
+
agenta-0.27.0a6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|