lmnr 0.5.3__py3-none-any.whl → 0.6.1__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.
- lmnr/__init__.py +6 -1
- lmnr/opentelemetry_lib/__init__.py +23 -36
- lmnr/opentelemetry_lib/decorators/__init__.py +219 -0
- lmnr/opentelemetry_lib/tracing/__init__.py +158 -1
- lmnr/opentelemetry_lib/tracing/_instrument_initializers.py +398 -0
- lmnr/opentelemetry_lib/tracing/attributes.py +14 -7
- lmnr/opentelemetry_lib/tracing/context_properties.py +53 -0
- lmnr/opentelemetry_lib/tracing/exporter.py +60 -0
- lmnr/opentelemetry_lib/tracing/instruments.py +121 -0
- lmnr/opentelemetry_lib/tracing/processor.py +96 -0
- lmnr/opentelemetry_lib/tracing/{context_manager.py → tracer.py} +6 -1
- lmnr/opentelemetry_lib/utils/package_check.py +3 -1
- lmnr/sdk/browser/browser_use_otel.py +1 -1
- lmnr/sdk/browser/playwright_otel.py +22 -7
- lmnr/sdk/browser/pw_utils.py +25 -9
- lmnr/sdk/client/asynchronous/resources/agent.py +3 -1
- lmnr/sdk/client/synchronous/resources/agent.py +3 -1
- lmnr/sdk/decorators.py +4 -2
- lmnr/sdk/evaluations.py +3 -3
- lmnr/sdk/laminar.py +28 -31
- lmnr/sdk/utils.py +2 -3
- lmnr/version.py +1 -1
- {lmnr-0.5.3.dist-info → lmnr-0.6.1.dist-info}/METADATA +65 -62
- {lmnr-0.5.3.dist-info → lmnr-0.6.1.dist-info}/RECORD +27 -28
- lmnr/opentelemetry_lib/config/__init__.py +0 -12
- lmnr/opentelemetry_lib/decorators/base.py +0 -210
- lmnr/opentelemetry_lib/instruments.py +0 -42
- lmnr/opentelemetry_lib/tracing/content_allow_list.py +0 -24
- lmnr/opentelemetry_lib/tracing/tracing.py +0 -1016
- lmnr/opentelemetry_lib/utils/in_memory_span_exporter.py +0 -61
- {lmnr-0.5.3.dist-info → lmnr-0.6.1.dist-info}/LICENSE +0 -0
- {lmnr-0.5.3.dist-info → lmnr-0.6.1.dist-info}/WHEEL +0 -0
- {lmnr-0.5.3.dist-info → lmnr-0.6.1.dist-info}/entry_points.txt +0 -0
@@ -1,61 +0,0 @@
|
|
1
|
-
# Copyright The OpenTelemetry Authors
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
import threading
|
16
|
-
import typing
|
17
|
-
|
18
|
-
from opentelemetry.sdk.trace import ReadableSpan
|
19
|
-
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
|
20
|
-
|
21
|
-
|
22
|
-
class InMemorySpanExporter(SpanExporter):
|
23
|
-
"""Implementation of :class:`.SpanExporter` that stores spans in memory.
|
24
|
-
|
25
|
-
This class can be used for testing purposes. It stores the exported spans
|
26
|
-
in a list in memory that can be retrieved using the
|
27
|
-
:func:`.get_finished_spans` method.
|
28
|
-
"""
|
29
|
-
|
30
|
-
def __init__(self) -> None:
|
31
|
-
self._finished_spans: typing.List[ReadableSpan] = []
|
32
|
-
self._stopped = False
|
33
|
-
self._lock = threading.Lock()
|
34
|
-
|
35
|
-
def clear(self) -> None:
|
36
|
-
"""Clear list of collected spans."""
|
37
|
-
with self._lock:
|
38
|
-
self._finished_spans.clear()
|
39
|
-
|
40
|
-
def get_finished_spans(self) -> typing.Tuple[ReadableSpan, ...]:
|
41
|
-
"""Get list of collected spans."""
|
42
|
-
with self._lock:
|
43
|
-
return tuple(self._finished_spans)
|
44
|
-
|
45
|
-
def export(self, spans: typing.Sequence[ReadableSpan]) -> SpanExportResult:
|
46
|
-
"""Stores a list of spans in memory."""
|
47
|
-
if self._stopped:
|
48
|
-
return SpanExportResult.FAILURE
|
49
|
-
with self._lock:
|
50
|
-
self._finished_spans.extend(spans)
|
51
|
-
return SpanExportResult.SUCCESS
|
52
|
-
|
53
|
-
def shutdown(self) -> None:
|
54
|
-
"""Shut downs the exporter.
|
55
|
-
|
56
|
-
Calls to export after the exporter has been shut down will fail.
|
57
|
-
"""
|
58
|
-
self._stopped = True
|
59
|
-
|
60
|
-
def force_flush(self, timeout_millis: int = 30000) -> bool:
|
61
|
-
return True
|
File without changes
|
File without changes
|
File without changes
|