dreadnode 1.0.7__tar.gz → 1.0.8__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.
- {dreadnode-1.0.7 → dreadnode-1.0.8}/PKG-INFO +1 -1
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/api/models.py +2 -2
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/tracing/span.py +18 -2
- {dreadnode-1.0.7 → dreadnode-1.0.8}/pyproject.toml +1 -1
- {dreadnode-1.0.7 → dreadnode-1.0.8}/README.md +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/__init__.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/api/__init__.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/api/client.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/api/util.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/artifact/__init__.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/artifact/merger.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/artifact/storage.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/artifact/tree_builder.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/constants.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/__init__.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/audio.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/base_data_type.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/image.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/object_3d.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/table.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/data_types/video.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/integrations/__init__.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/integrations/transformers.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/main.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/metric.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/object.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/py.typed +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/serialization.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/task.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/tracing/__init__.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/tracing/constants.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/tracing/exporters.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/types.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/util.py +0 -0
- {dreadnode-1.0.7 → dreadnode-1.0.8}/dreadnode/version.py +0 -0
|
@@ -122,7 +122,7 @@ class TraceSpan(BaseModel):
|
|
|
122
122
|
class Metric(BaseModel):
|
|
123
123
|
"""Metric data for a span in a trace."""
|
|
124
124
|
|
|
125
|
-
value: float
|
|
125
|
+
value: float | None
|
|
126
126
|
"""Value of the metric."""
|
|
127
127
|
step: int
|
|
128
128
|
"""Step or iteration number for the metric."""
|
|
@@ -268,7 +268,7 @@ class ArtifactDir(BaseModel):
|
|
|
268
268
|
class RunSummary(BaseModel):
|
|
269
269
|
"""Summary of a run, containing metadata and basic information."""
|
|
270
270
|
|
|
271
|
-
id: ULID
|
|
271
|
+
id: ULID | str
|
|
272
272
|
"""Unique identifier for the run."""
|
|
273
273
|
name: str
|
|
274
274
|
"""Name of the run."""
|
|
@@ -23,6 +23,7 @@ from opentelemetry import propagate
|
|
|
23
23
|
from opentelemetry import trace as trace_api
|
|
24
24
|
from opentelemetry.sdk.trace import ReadableSpan
|
|
25
25
|
from opentelemetry.trace import Tracer
|
|
26
|
+
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
|
|
26
27
|
from opentelemetry.util import types as otel_types
|
|
27
28
|
from ulid import ULID
|
|
28
29
|
|
|
@@ -358,8 +359,23 @@ class RunSpan(Span):
|
|
|
358
359
|
raise RuntimeError("You cannot start a run span within another run")
|
|
359
360
|
|
|
360
361
|
if self._remote_context is not None:
|
|
361
|
-
|
|
362
|
-
|
|
362
|
+
# If the global propagator is a NoExtract instance, we can't continue
|
|
363
|
+
# a trace, so we'll bypass it and use the W3C propagator directly.
|
|
364
|
+
global_propagator = propagate.get_global_textmap()
|
|
365
|
+
if "NoExtract" in type(global_propagator).__name__:
|
|
366
|
+
w3c_propagator = TraceContextTextMapPropagator()
|
|
367
|
+
otel_context = w3c_propagator.extract(carrier=self._remote_context)
|
|
368
|
+
else:
|
|
369
|
+
otel_context = propagate.extract(carrier=self._remote_context)
|
|
370
|
+
|
|
371
|
+
span_context = trace_api.get_current_span(otel_context).get_span_context()
|
|
372
|
+
|
|
373
|
+
# If we have a valid trace_id, we can attach the context and continue the trace.
|
|
374
|
+
if span_context.trace_id != 0:
|
|
375
|
+
self._remote_token = context_api.attach(otel_context)
|
|
376
|
+
else:
|
|
377
|
+
# Fall back to creating a new span if the context is invalid.
|
|
378
|
+
super().__enter__()
|
|
363
379
|
else:
|
|
364
380
|
super().__enter__()
|
|
365
381
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|