hatchet-sdk 0.45.3b1__py3-none-any.whl → 0.46.0__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 hatchet-sdk might be problematic. Click here for more details.
- hatchet_sdk/clients/admin.py +63 -127
- hatchet_sdk/clients/dispatcher/action_listener.py +18 -21
- hatchet_sdk/clients/events.py +48 -85
- hatchet_sdk/loader.py +14 -40
- hatchet_sdk/opentelemetry/instrumentor.py +323 -0
- hatchet_sdk/worker/runner/runner.py +102 -140
- {hatchet_sdk-0.45.3b1.dist-info → hatchet_sdk-0.46.0.dist-info}/METADATA +8 -8
- {hatchet_sdk-0.45.3b1.dist-info → hatchet_sdk-0.46.0.dist-info}/RECORD +10 -10
- {hatchet_sdk-0.45.3b1.dist-info → hatchet_sdk-0.46.0.dist-info}/entry_points.txt +1 -0
- hatchet_sdk/utils/tracing.py +0 -70
- {hatchet_sdk-0.45.3b1.dist-info → hatchet_sdk-0.46.0.dist-info}/WHEEL +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
hatchet_sdk/__init__.py,sha256=R5ogd_Dn_6gA_u9a5W2URNq6eDtN1i56cObBv1tOwyU,9408
|
|
2
2
|
hatchet_sdk/client.py,sha256=ajjLd-gZptVuAx25gG_SdAW8xDA4V7HMIhgYuh9MkVY,3486
|
|
3
|
-
hatchet_sdk/clients/admin.py,sha256=
|
|
4
|
-
hatchet_sdk/clients/dispatcher/action_listener.py,sha256=
|
|
3
|
+
hatchet_sdk/clients/admin.py,sha256=4bfm91bqmGte5K09JnG1PciuU2zjjJ_j4AskPdq6bXc,18099
|
|
4
|
+
hatchet_sdk/clients/dispatcher/action_listener.py,sha256=KoMCD1h6DIoOsHXkX1a5wTsf6-w_gw9vVO6PhCk-uLI,15393
|
|
5
5
|
hatchet_sdk/clients/dispatcher/dispatcher.py,sha256=5ArB3qPy5tetkn38pURWaXLduuRb8iDOjYWjVbbBX-U,6667
|
|
6
6
|
hatchet_sdk/clients/event_ts.py,sha256=ACGvDdfhvK6ZLKdsPxy-PksLhjIU69P9cdH3AxX-X10,728
|
|
7
|
-
hatchet_sdk/clients/events.py,sha256=
|
|
7
|
+
hatchet_sdk/clients/events.py,sha256=vRIKZu964cVIx89lpm5vXQwtVWSck0hTh7s_FxE9zmA,5880
|
|
8
8
|
hatchet_sdk/clients/rest/__init__.py,sha256=YW-1qeo5pfYB4cad36eXVxb5ta-L-75SfNBw1Oglc18,14265
|
|
9
9
|
hatchet_sdk/clients/rest/api/__init__.py,sha256=LaTEK7cYklb8R0iYj727C-jVk-MGHenADN8TJpoIASs,1067
|
|
10
10
|
hatchet_sdk/clients/rest/api/api_token_api.py,sha256=C10FEIHHGBpwq-bIKkrBhvPlg6az4aHlREWEUlJHWl0,33577
|
|
@@ -206,9 +206,10 @@ hatchet_sdk/features/cron.py,sha256=4lKMH0MqiN8cHJk2jhF0Ueqs6z5ozwJzlOeSeaWqvO0,
|
|
|
206
206
|
hatchet_sdk/features/scheduled.py,sha256=YhEbNWl8dWOH61rXVjAyu8iG1BZqpSkD4kgaxkKIHgY,9504
|
|
207
207
|
hatchet_sdk/hatchet.py,sha256=L6O9cTeZtGqFUxO5H8knXKdiej0iAequ1Wl7vSNO9FY,10027
|
|
208
208
|
hatchet_sdk/labels.py,sha256=Axfp1yUNowzE9mL8AQA1ADqwOaNmq3QP_45wb1Ed1aI,272
|
|
209
|
-
hatchet_sdk/loader.py,sha256=
|
|
209
|
+
hatchet_sdk/loader.py,sha256=m8NFnDU-NMZQ_ay2LzRI6QThix4Dv2zKCXY9GcAMlvo,8203
|
|
210
210
|
hatchet_sdk/logger.py,sha256=5uOr52T4mImSQm1QvWT8HvZFK5WfPNh3Y1cBQZRFgUQ,333
|
|
211
211
|
hatchet_sdk/metadata.py,sha256=M_Cb-CXRKitzVMQHeaHUtbY28ET__fAbyGX1YKaeN4I,80
|
|
212
|
+
hatchet_sdk/opentelemetry/instrumentor.py,sha256=FKYxilEjZJvQg4BJFLveV-gg2r7-30S8_BP6hl5tIfA,11173
|
|
212
213
|
hatchet_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
213
214
|
hatchet_sdk/rate_limit.py,sha256=IIzpe65i-518t9kQcZVEykDQ2VY8sOw2F7qlQ4wlAjw,4421
|
|
214
215
|
hatchet_sdk/semver.py,sha256=PrgBL0TnyXl3p_OK1iSMk9Gpujfh5asQpJ4DHJLCW2k,998
|
|
@@ -216,7 +217,6 @@ hatchet_sdk/token.py,sha256=Ap3jnbaPAL10F2G_D71wj7OpBcvrI3RuE0keqXx1lAE,698
|
|
|
216
217
|
hatchet_sdk/utils/aio_utils.py,sha256=D92Z1lc84u8f1mVE3XzOv9XtRKfCIvwfdfL-Bo5fJA8,4336
|
|
217
218
|
hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
|
|
218
219
|
hatchet_sdk/utils/serialization.py,sha256=P2Uq0yxg-Cea5Lmf6IOh2r7W17MNF1Hv2qxSny6BUk8,451
|
|
219
|
-
hatchet_sdk/utils/tracing.py,sha256=UjTw2vMLg1p6GjOGwt634nYJaNZh8c70PBxOBVLiDQ4,2261
|
|
220
220
|
hatchet_sdk/utils/types.py,sha256=qhx1OoeXh77AN6s4SMaGpB3zK3hPm7ocv-23JFa6_wE,191
|
|
221
221
|
hatchet_sdk/utils/typing.py,sha256=ab1FdF8OAXjcFq9Ui7Bd6yi8ZX473rIqFAqXJnh5AEM,261
|
|
222
222
|
hatchet_sdk/v2/callable.py,sha256=DqBc3VS7WAk5qU9Ef1HnyAzdgxUq1hDzj-CwQYQrvcA,6948
|
|
@@ -225,13 +225,13 @@ hatchet_sdk/v2/hatchet.py,sha256=mQZoloWuRCIEwDwXeTaJL2kBjgs9YLHy7UPWxBD5070,728
|
|
|
225
225
|
hatchet_sdk/worker/__init__.py,sha256=1Ze1seDuXx5yD1IfHmqGFgK5qrRazVW4ZcDVGl-Pddw,61
|
|
226
226
|
hatchet_sdk/worker/action_listener_process.py,sha256=tmlzDgyHWxGl8fJWE9NKqjvhqpGi9SMmOh5dFyiVL-Q,9979
|
|
227
227
|
hatchet_sdk/worker/runner/run_loop_manager.py,sha256=nV7fhNxJKCcrBm0ci118aszF_7AxenBkOTIe1UsBEt4,3490
|
|
228
|
-
hatchet_sdk/worker/runner/runner.py,sha256=
|
|
228
|
+
hatchet_sdk/worker/runner/runner.py,sha256=ycua4H86hUi1Qds-L-BrB0rN2WyLmYoOlVGBsZLoihU,16519
|
|
229
229
|
hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=s_BGxeykelVbusx6u31EPx3vv9c2BHkuBnYcaLW680E,2381
|
|
230
230
|
hatchet_sdk/worker/runner/utils/error_with_traceback.py,sha256=Iih_s8JNqrinXETFJ3ZS88EhaTekfM6m5fqIP7QWoIM,181
|
|
231
231
|
hatchet_sdk/worker/worker.py,sha256=7UPm3qTzNYSSm9QTNX6zBBMJqVA6nKFeCbAdqLLjUBs,13007
|
|
232
232
|
hatchet_sdk/workflow.py,sha256=XRj5jcCQSvPQMXxBipf-ZlARua2E8Z9igRzGcQ5alkI,9375
|
|
233
233
|
hatchet_sdk/workflow_run.py,sha256=BwK5cefvXXvyQ1Ednj_7LeejMwQJqWnvUC_FTBmJNxk,1805
|
|
234
|
-
hatchet_sdk-0.
|
|
235
|
-
hatchet_sdk-0.
|
|
236
|
-
hatchet_sdk-0.
|
|
237
|
-
hatchet_sdk-0.
|
|
234
|
+
hatchet_sdk-0.46.0.dist-info/METADATA,sha256=-YCLlzRJLRFd3khigA52tYceAN5xPQjWRF2Ghi4B3vU,1826
|
|
235
|
+
hatchet_sdk-0.46.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
236
|
+
hatchet_sdk-0.46.0.dist-info/entry_points.txt,sha256=Rxdx7OJUxSHsSjYLUI_JcInpYIFl9vPaMvbl5TGMzdA,1079
|
|
237
|
+
hatchet_sdk-0.46.0.dist-info/RECORD,,
|
|
@@ -15,6 +15,7 @@ fanout=examples.fanout.worker:main
|
|
|
15
15
|
logger=examples.logger.worker:main
|
|
16
16
|
manual_trigger=examples.manual_trigger.worker:main
|
|
17
17
|
on_failure=examples.on_failure.worker:main
|
|
18
|
+
otel=examples.opentelemetry_instrumentation.worker:main
|
|
18
19
|
programatic_replay=examples.programatic_replay.worker:main
|
|
19
20
|
pydantic=examples.pydantic.worker:main
|
|
20
21
|
rate_limit=examples.rate_limit.worker:main
|
hatchet_sdk/utils/tracing.py
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from functools import cache
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from opentelemetry import trace
|
|
6
|
-
from opentelemetry.context import Context
|
|
7
|
-
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
|
|
8
|
-
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
|
|
9
|
-
from opentelemetry.sdk.trace import TracerProvider
|
|
10
|
-
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
11
|
-
from opentelemetry.trace import NoOpTracerProvider, Tracer
|
|
12
|
-
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
|
|
13
|
-
|
|
14
|
-
from hatchet_sdk.loader import ClientConfig
|
|
15
|
-
|
|
16
|
-
OTEL_CARRIER_KEY = "__otel_carrier"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@cache
|
|
20
|
-
def create_tracer(config: ClientConfig) -> Tracer:
|
|
21
|
-
## TODO: Figure out how to specify protocol here
|
|
22
|
-
resource = Resource(
|
|
23
|
-
attributes={SERVICE_NAME: config.otel_service_name or "hatchet.run"}
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
if config.otel_exporter_oltp_endpoint and config.otel_exporter_oltp_headers:
|
|
27
|
-
processor = BatchSpanProcessor(
|
|
28
|
-
OTLPSpanExporter(
|
|
29
|
-
endpoint=config.otel_exporter_oltp_endpoint,
|
|
30
|
-
headers=config.otel_exporter_oltp_headers,
|
|
31
|
-
),
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
## If tracer provider is already set, we don't need to override it
|
|
35
|
-
if not isinstance(trace.get_tracer_provider(), TracerProvider):
|
|
36
|
-
trace_provider = TracerProvider(resource=resource)
|
|
37
|
-
trace_provider.add_span_processor(processor)
|
|
38
|
-
trace.set_tracer_provider(trace_provider)
|
|
39
|
-
else:
|
|
40
|
-
if not isinstance(trace.get_tracer_provider(), NoOpTracerProvider):
|
|
41
|
-
trace.set_tracer_provider(NoOpTracerProvider())
|
|
42
|
-
|
|
43
|
-
return trace.get_tracer(__name__)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def create_carrier() -> dict[str, str]:
|
|
47
|
-
carrier: dict[str, str] = {}
|
|
48
|
-
TraceContextTextMapPropagator().inject(carrier)
|
|
49
|
-
|
|
50
|
-
return carrier
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def inject_carrier_into_metadata(
|
|
54
|
-
metadata: dict[Any, Any], carrier: dict[str, str]
|
|
55
|
-
) -> dict[Any, Any]:
|
|
56
|
-
if carrier:
|
|
57
|
-
metadata[OTEL_CARRIER_KEY] = carrier
|
|
58
|
-
|
|
59
|
-
return metadata
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def parse_carrier_from_metadata(metadata: dict[str, Any] | None) -> Context | None:
|
|
63
|
-
if not metadata:
|
|
64
|
-
return None
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
TraceContextTextMapPropagator().extract(_ctx)
|
|
68
|
-
if (_ctx := metadata.get(OTEL_CARRIER_KEY))
|
|
69
|
-
else None
|
|
70
|
-
)
|
|
File without changes
|