chalk-remote-call-python 1.6.0__tar.gz → 1.6.2__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.
Files changed (63) hide show
  1. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/PKG-INFO +5 -1
  2. chalk_remote_call_python-1.6.2/chalk_remote_call/_version.py +1 -0
  3. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/tracing.py +15 -0
  4. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call_python.egg-info/PKG-INFO +5 -1
  5. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call_python.egg-info/requires.txt +5 -0
  6. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/pyproject.toml +5 -0
  7. chalk_remote_call_python-1.6.0/chalk_remote_call/_version.py +0 -1
  8. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/MANIFEST.in +0 -0
  9. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/README.md +0 -0
  10. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/Cargo.lock +0 -0
  11. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/Cargo.toml +0 -0
  12. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/Cargo.toml +0 -0
  13. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.auth.v1.rs +0 -0
  14. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.common.v1.rs +0 -0
  15. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.rs +0 -0
  16. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.tonic.rs +0 -0
  17. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.utils.v1.rs +0 -0
  18. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/descriptor.bin +0 -0
  19. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-proto/src/lib.rs +0 -0
  20. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-server/Cargo.toml +0 -0
  21. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-server/src/coalesce.rs +0 -0
  22. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-server/src/lib.rs +0 -0
  23. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-server/src/python_bridge.rs +0 -0
  24. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-server/src/server.rs +0 -0
  25. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/chalk-remote-call-server/src/service.rs +0 -0
  26. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk-remote-call-rs/rust-toolchain.toml +0 -0
  27. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/__init__.py +0 -0
  28. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/__main__.py +0 -0
  29. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/__init__.py +0 -0
  30. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/__init__.py +0 -0
  31. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/auth/__init__.py +0 -0
  32. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/auth/v1/__init__.py +0 -0
  33. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2.py +0 -0
  34. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2_grpc.py +0 -0
  35. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/common/__init__.py +0 -0
  36. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/common/v1/__init__.py +0 -0
  37. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2.py +0 -0
  38. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2_grpc.py +0 -0
  39. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/runtime/__init__.py +0 -0
  40. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/runtime/v1/__init__.py +0 -0
  41. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2.py +0 -0
  42. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2_grpc.py +0 -0
  43. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/__init__.py +0 -0
  44. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/__init__.py +0 -0
  45. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2.py +0 -0
  46. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2_grpc.py +0 -0
  47. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2.py +0 -0
  48. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2_grpc.py +0 -0
  49. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2.py +0 -0
  50. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2_grpc.py +0 -0
  51. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/_native.pyi +0 -0
  52. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/arrow_utils.py +0 -0
  53. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/cli.py +0 -0
  54. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/handler_loader.py +0 -0
  55. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/input_transform.py +0 -0
  56. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/server.py +0 -0
  57. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call/servicer.py +0 -0
  58. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call_python.egg-info/SOURCES.txt +0 -0
  59. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call_python.egg-info/dependency_links.txt +0 -0
  60. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call_python.egg-info/entry_points.txt +0 -0
  61. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/chalk_remote_call_python.egg-info/top_level.txt +0 -0
  62. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/setup.cfg +0 -0
  63. {chalk_remote_call_python-1.6.0 → chalk_remote_call_python-1.6.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalk-remote-call-python
3
- Version: 1.6.0
3
+ Version: 1.6.2
4
4
  Summary: Chalk remote call Python runtime interface client
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -31,6 +31,10 @@ Requires-Dist: grpcio-health-checking>=1.60.0; extra == "dev"
31
31
  Requires-Dist: grpcio-reflection>=1.60.0; extra == "dev"
32
32
  Requires-Dist: protobuf>=4.25.0; extra == "dev"
33
33
  Requires-Dist: grpcio-tools>=1.60.0; extra == "dev"
34
+ Provides-Extra: tracing
35
+ Requires-Dist: opentelemetry-api>=1.20.0; extra == "tracing"
36
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "tracing"
37
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.20.0; extra == "tracing"
34
38
 
35
39
  # chalk-remote-call-python
36
40
 
@@ -0,0 +1 @@
1
+ __version__ = "1.6.2"
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import atexit
3
4
  import contextlib
4
5
  import importlib
5
6
  import os
@@ -122,11 +123,20 @@ def _configure_runtime_tracing(sample_rate: float) -> None:
122
123
 
123
124
  trace_api.set_tracer_provider(provider)
124
125
  _runtime_tracer_provider = provider
126
+ atexit.register(provider.shutdown)
125
127
  except Exception:
126
128
  pass
127
129
  _runtime_tracing_configured = True
128
130
 
129
131
 
132
+ def _sample_rate_for_inherited_parent(policy: str) -> float | None:
133
+ if policy == _TRACE_POLICY_PARENT_BASED_ALWAYS_OFF:
134
+ return 0.0
135
+ if policy == _TRACE_POLICY_PARENT_BASED_TRACE_ID_RATIO:
136
+ return _trace_sample_rate()
137
+ return None
138
+
139
+
130
140
  def _span_metadata(
131
141
  first_metadata: Mapping[str, Any] | None,
132
142
  traceparent_metadata: Mapping[str, Any] | None,
@@ -146,6 +156,11 @@ def _span_metadata(
146
156
  parent_span_context = trace.get_current_span(parent_context).get_span_context()
147
157
  if not parent_span_context.is_valid:
148
158
  return None, None, None
159
+
160
+ sample_rate = _sample_rate_for_inherited_parent(policy)
161
+ if sample_rate is None:
162
+ return None, None, None
163
+ _configure_runtime_tracing(sample_rate)
149
164
  return traceparent_metadata, parent_context, otel_modules
150
165
 
151
166
  if policy != _TRACE_POLICY_PARENT_BASED_TRACE_ID_RATIO:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalk-remote-call-python
3
- Version: 1.6.0
3
+ Version: 1.6.2
4
4
  Summary: Chalk remote call Python runtime interface client
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -31,6 +31,10 @@ Requires-Dist: grpcio-health-checking>=1.60.0; extra == "dev"
31
31
  Requires-Dist: grpcio-reflection>=1.60.0; extra == "dev"
32
32
  Requires-Dist: protobuf>=4.25.0; extra == "dev"
33
33
  Requires-Dist: grpcio-tools>=1.60.0; extra == "dev"
34
+ Provides-Extra: tracing
35
+ Requires-Dist: opentelemetry-api>=1.20.0; extra == "tracing"
36
+ Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "tracing"
37
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.20.0; extra == "tracing"
34
38
 
35
39
  # chalk-remote-call-python
36
40
 
@@ -9,3 +9,8 @@ grpcio-health-checking>=1.60.0
9
9
  grpcio-reflection>=1.60.0
10
10
  protobuf>=4.25.0
11
11
  grpcio-tools>=1.60.0
12
+
13
+ [tracing]
14
+ opentelemetry-api>=1.20.0
15
+ opentelemetry-sdk>=1.20.0
16
+ opentelemetry-exporter-otlp-proto-grpc>=1.20.0
@@ -44,6 +44,11 @@ dev = [
44
44
  "protobuf>=4.25.0",
45
45
  "grpcio-tools>=1.60.0",
46
46
  ]
47
+ tracing = [
48
+ "opentelemetry-api>=1.20.0",
49
+ "opentelemetry-sdk>=1.20.0",
50
+ "opentelemetry-exporter-otlp-proto-grpc>=1.20.0",
51
+ ]
47
52
 
48
53
  [project.urls]
49
54
  Homepage = "https://chalk.ai"
@@ -1 +0,0 @@
1
- __version__ = "1.6.0"