dbos 0.26.0a24__py3-none-any.whl → 0.27.0a1__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 dbos might be problematic. Click here for more details.
- dbos/_dbos.py +6 -1
- dbos/_dbos_config.py +0 -12
- dbos/_tracer.py +9 -1
- {dbos-0.26.0a24.dist-info → dbos-0.27.0a1.dist-info}/METADATA +1 -1
- {dbos-0.26.0a24.dist-info → dbos-0.27.0a1.dist-info}/RECORD +8 -8
- {dbos-0.26.0a24.dist-info → dbos-0.27.0a1.dist-info}/WHEEL +0 -0
- {dbos-0.26.0a24.dist-info → dbos-0.27.0a1.dist-info}/entry_points.txt +0 -0
- {dbos-0.26.0a24.dist-info → dbos-0.27.0a1.dist-info}/licenses/LICENSE +0 -0
dbos/_dbos.py
CHANGED
|
@@ -65,7 +65,7 @@ from ._registrations import (
|
|
|
65
65
|
from ._roles import default_required_roles, required_roles
|
|
66
66
|
from ._scheduler import ScheduledWorkflow, scheduled
|
|
67
67
|
from ._sys_db import StepInfo, WorkflowStatus, reset_system_database
|
|
68
|
-
from ._tracer import dbos_tracer
|
|
68
|
+
from ._tracer import DBOSTracer, dbos_tracer
|
|
69
69
|
|
|
70
70
|
if TYPE_CHECKING:
|
|
71
71
|
from fastapi import FastAPI
|
|
@@ -1166,6 +1166,11 @@ class DBOS:
|
|
|
1166
1166
|
ctx.authenticated_user = authenticated_user
|
|
1167
1167
|
ctx.authenticated_roles = authenticated_roles
|
|
1168
1168
|
|
|
1169
|
+
@classproperty
|
|
1170
|
+
def tracer(self) -> DBOSTracer:
|
|
1171
|
+
"""Return the DBOS OpenTelemetry tracer."""
|
|
1172
|
+
return dbos_tracer
|
|
1173
|
+
|
|
1169
1174
|
|
|
1170
1175
|
class WorkflowHandle(Generic[R], Protocol):
|
|
1171
1176
|
"""
|
dbos/_dbos_config.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import inspect
|
|
2
1
|
import json
|
|
3
2
|
import os
|
|
4
3
|
import re
|
|
@@ -311,17 +310,6 @@ def load_config(
|
|
|
311
310
|
|
|
312
311
|
"""
|
|
313
312
|
|
|
314
|
-
# Get the current call stack
|
|
315
|
-
frame_records = inspect.stack()
|
|
316
|
-
called_from_cli = False
|
|
317
|
-
for frame_record in frame_records:
|
|
318
|
-
if "dbos/cli/cli.py" in frame_record.filename:
|
|
319
|
-
called_from_cli = True
|
|
320
|
-
if not called_from_cli and not silent:
|
|
321
|
-
dbos_logger.warning(
|
|
322
|
-
"This function is deprecated and will be removed in a future version. Use `DBOS.config` instead."
|
|
323
|
-
)
|
|
324
|
-
|
|
325
313
|
with open(config_file_path, "r") as file:
|
|
326
314
|
content = file.read()
|
|
327
315
|
substituted_content = _substitute_env_vars(content, silent=silent)
|
dbos/_tracer.py
CHANGED
|
@@ -3,8 +3,10 @@ from typing import TYPE_CHECKING, Optional
|
|
|
3
3
|
|
|
4
4
|
from opentelemetry import trace
|
|
5
5
|
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
|
|
6
|
+
from opentelemetry.sdk.resources import Resource
|
|
6
7
|
from opentelemetry.sdk.trace import TracerProvider
|
|
7
8
|
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
|
|
9
|
+
from opentelemetry.semconv.resource import ResourceAttributes
|
|
8
10
|
from opentelemetry.trace import Span
|
|
9
11
|
|
|
10
12
|
from dbos._utils import GlobalParams
|
|
@@ -23,7 +25,13 @@ class DBOSTracer:
|
|
|
23
25
|
|
|
24
26
|
def config(self, config: ConfigFile) -> None:
|
|
25
27
|
if not isinstance(trace.get_tracer_provider(), TracerProvider):
|
|
26
|
-
|
|
28
|
+
resource = Resource(
|
|
29
|
+
attributes={
|
|
30
|
+
ResourceAttributes.SERVICE_NAME: config["name"],
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
provider = TracerProvider(resource=resource)
|
|
27
35
|
if os.environ.get("DBOS__CONSOLE_TRACES", None) is not None:
|
|
28
36
|
processor = BatchSpanProcessor(ConsoleSpanExporter())
|
|
29
37
|
provider.add_span_processor(processor)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dbos-0.
|
|
2
|
-
dbos-0.
|
|
3
|
-
dbos-0.
|
|
4
|
-
dbos-0.
|
|
1
|
+
dbos-0.27.0a1.dist-info/METADATA,sha256=nMy0nH7zk4m1-hfxOaZ6kt0Hk9NEAS9lLGH3h8Y_UVA,5553
|
|
2
|
+
dbos-0.27.0a1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
|
3
|
+
dbos-0.27.0a1.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
|
4
|
+
dbos-0.27.0a1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
|
5
5
|
dbos/__init__.py,sha256=VoGS7H9GVtNAnD2S4zseIEioS1dNIJXRovQ4oHlg8og,842
|
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
|
7
7
|
dbos/_admin_server.py,sha256=RrbABfR1D3p9c_QLrCSrgFuYce6FKi0fjMRIYLjO_Y8,9038
|
|
@@ -13,8 +13,8 @@ dbos/_conductor/protocol.py,sha256=zEKIuOQdIaSduNqfZKpo8PSD9_1oNpKIPnBNCu3RUyE,6
|
|
|
13
13
|
dbos/_context.py,sha256=aHzJxO7LLAz9w3G2dkZnOcFW_GG-Yaxd02AaoLu4Et8,21861
|
|
14
14
|
dbos/_core.py,sha256=ylTVSv02h2M5SmDgYEJAZmNiKX35zPq0z-9WA-f4byY,47900
|
|
15
15
|
dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
|
|
16
|
-
dbos/_dbos.py,sha256=
|
|
17
|
-
dbos/_dbos_config.py,sha256=
|
|
16
|
+
dbos/_dbos.py,sha256=aXpoMSpbfT64LmVUigrcjXTaJAPVHu0G35sn9VAucy0,47490
|
|
17
|
+
dbos/_dbos_config.py,sha256=Q_YH1HSWzCzzCX7m6z3EjTp_YIjtFbohil6qmcmNARI,21311
|
|
18
18
|
dbos/_debug.py,sha256=MNlQVZ6TscGCRQeEEL0VE8Uignvr6dPeDDDefS3xgIE,1823
|
|
19
19
|
dbos/_docker_pg_helper.py,sha256=NmcgqmR5rQA_4igfeqh8ugNT2z3YmoOvuep_MEtxTiY,5854
|
|
20
20
|
dbos/_error.py,sha256=9ITvFsN_Udpx0xXtYQHXXXb6PjPr3TmMondGmprV-L0,7003
|
|
@@ -57,7 +57,7 @@ dbos/_templates/dbos-db-starter/migrations/env.py.dbos,sha256=GUV6sjkDzf9Vl6wkGE
|
|
|
57
57
|
dbos/_templates/dbos-db-starter/migrations/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
|
58
58
|
dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py,sha256=MpS7LGaJS0CpvsjhfDkp9EJqvMvVCjRPfUp4c0aE2ys,941
|
|
59
59
|
dbos/_templates/dbos-db-starter/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKse9HsWv5fynJEFJHM,1681
|
|
60
|
-
dbos/_tracer.py,sha256=
|
|
60
|
+
dbos/_tracer.py,sha256=yN6GRDKu_1p-EqtQLNarMocPfga2ZuqpzStzzSPYhzo,2732
|
|
61
61
|
dbos/_utils.py,sha256=nFRUHzVjXG5AusF85AlYHikj63Tzi-kQm992ihsrAxA,201
|
|
62
62
|
dbos/_workflow_commands.py,sha256=7wyxTfIyh2IVIqlkaTr8CMBq8yxWP3Hhddyv1YJY8zE,3576
|
|
63
63
|
dbos/cli/_github_init.py,sha256=Y_bDF9gfO2jB1id4FV5h1oIxEJRWyqVjhb7bNEa5nQ0,3224
|
|
@@ -66,4 +66,4 @@ dbos/cli/cli.py,sha256=1qCTs__A9LOEfU44XZ6TufwmRwe68ZEwbWEPli3vnVM,17873
|
|
|
66
66
|
dbos/dbos-config.schema.json,sha256=8KcwJb_sQc4-6tQG2TLmjE_nratfrQa0qVLl9XPsvWE,6367
|
|
67
67
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
|
68
68
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
|
69
|
-
dbos-0.
|
|
69
|
+
dbos-0.27.0a1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|