chalk-remote-call-python 1.8.0__tar.gz → 1.8.1__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 (66) hide show
  1. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/PKG-INFO +1 -1
  2. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/metrics.rs +28 -17
  3. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/self_consumer.rs +11 -10
  4. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/server.rs +1 -1
  5. chalk_remote_call_python-1.8.1/chalk_remote_call/_version.py +1 -0
  6. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call_python.egg-info/PKG-INFO +1 -1
  7. chalk_remote_call_python-1.8.0/chalk_remote_call/_version.py +0 -1
  8. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/MANIFEST.in +0 -0
  9. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/README.md +0 -0
  10. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/Cargo.lock +0 -0
  11. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/Cargo.toml +0 -0
  12. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/Cargo.toml +0 -0
  13. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.auth.v1.rs +0 -0
  14. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.common.v1.rs +0 -0
  15. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.rs +0 -0
  16. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.tonic.rs +0 -0
  17. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.utils.v1.rs +0 -0
  18. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/descriptor.bin +0 -0
  19. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-proto/src/lib.rs +0 -0
  20. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/Cargo.toml +0 -0
  21. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/async_service.rs +0 -0
  22. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/coalesce.rs +0 -0
  23. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/lib.rs +0 -0
  24. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/python_bridge.rs +0 -0
  25. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/chalk-remote-call-server/src/service.rs +0 -0
  26. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk-remote-call-rs/rust-toolchain.toml +0 -0
  27. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/__init__.py +0 -0
  28. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/__main__.py +0 -0
  29. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/__init__.py +0 -0
  30. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/__init__.py +0 -0
  31. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/auth/__init__.py +0 -0
  32. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/auth/v1/__init__.py +0 -0
  33. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2.py +0 -0
  34. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2_grpc.py +0 -0
  35. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/common/__init__.py +0 -0
  36. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/common/v1/__init__.py +0 -0
  37. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2.py +0 -0
  38. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2_grpc.py +0 -0
  39. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/runtime/__init__.py +0 -0
  40. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/runtime/v1/__init__.py +0 -0
  41. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2.py +0 -0
  42. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2_grpc.py +0 -0
  43. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/__init__.py +0 -0
  44. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/__init__.py +0 -0
  45. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2.py +0 -0
  46. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2_grpc.py +0 -0
  47. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2.py +0 -0
  48. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2_grpc.py +0 -0
  49. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2.py +0 -0
  50. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2_grpc.py +0 -0
  51. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/_native.pyi +0 -0
  52. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/arrow_utils.py +0 -0
  53. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/cli.py +0 -0
  54. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/handler_loader.py +0 -0
  55. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/input_transform.py +0 -0
  56. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/server.py +0 -0
  57. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/servicer.py +0 -0
  58. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call/tracing.py +0 -0
  59. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call_python.egg-info/SOURCES.txt +0 -0
  60. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call_python.egg-info/dependency_links.txt +0 -0
  61. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call_python.egg-info/entry_points.txt +0 -0
  62. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call_python.egg-info/requires.txt +0 -0
  63. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/chalk_remote_call_python.egg-info/top_level.txt +0 -0
  64. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/pyproject.toml +0 -0
  65. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/setup.cfg +0 -0
  66. {chalk_remote_call_python-1.8.0 → chalk_remote_call_python-1.8.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalk-remote-call-python
3
- Version: 1.8.0
3
+ Version: 1.8.1
4
4
  Summary: Chalk remote call Python runtime interface client
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -1,6 +1,6 @@
1
1
  //! Metrics emission for the self-consuming shim, mirroring the catalog
2
2
  //! consumer / fnq-server: build a `chalk_metrics` publishing pipeline at startup
3
- //! and emit `FunctionCallDequeued` per executed call.
3
+ //! and emit per-call dequeue + processing-latency metrics.
4
4
  //!
5
5
  //! The External Function "Function Calls Dequeued" chart reads TimescaleDB
6
6
  //! `metrics1`, which is fed only by the chalk_metrics PubSub bus (statsd goes to
@@ -42,9 +42,7 @@ pub async fn init_pipeline() -> Option<Arc<dyn MetricsPipeline>> {
42
42
 
43
43
  let publishers: Vec<Arc<dyn BusPublisher>> = build_bus_publisher().await.into_iter().collect();
44
44
  if publishers.is_empty() {
45
- warn!(
46
- "no metrics bus publisher configured; FunctionCallDequeued will not reach the dashboard"
47
- );
45
+ warn!("no metrics bus publisher configured; function call metrics will not reach the dashboard");
48
46
  }
49
47
 
50
48
  let metrics_pipeline: Arc<dyn MetricsPipeline> =
@@ -106,24 +104,37 @@ async fn build_bus_publisher() -> Option<Arc<dyn BusPublisher>> {
106
104
  }
107
105
  }
108
106
 
109
- /// Emit one `FunctionCallDequeued` count for a completed call, tagged with the
110
- /// function name and success/failure — mirroring the catalog consumer's emission
111
- /// (minus the scaling-group revision tag, which the shim does not carry; the
112
- /// dashboard filters by function name only).
113
- pub fn record_dequeue(pipeline: &Arc<dyn MetricsPipeline>, function_name: &str, success: bool) {
107
+ /// Emit completed-call metrics tagged with function name and success/failure.
108
+ ///
109
+ /// `FunctionCallProcessingLatency` is defined as a sketch in metrics.cue, which
110
+ /// is emitted through the histogram API in chalk_metrics. The shim does not
111
+ /// carry the scaling-group revision tag used by the legacy catalog consumer;
112
+ /// the dashboard filters by function name.
113
+ pub fn record_completed_call(
114
+ pipeline: &Arc<dyn MetricsPipeline>,
115
+ function_name: &str,
116
+ success: bool,
117
+ elapsed: Duration,
118
+ ) {
114
119
  let status = if success {
115
120
  MetricStatus::Success
116
121
  } else {
117
122
  MetricStatus::Failure
118
123
  };
119
- if let Err(e) = pipeline.count(
120
- WellKnownMetricName::FunctionCallDequeued,
121
- 1.0,
122
- vec![
123
- TagValue::FunctionName(FunctionName(function_name.to_string())),
124
- TagValue::Status(status),
125
- ],
126
- ) {
124
+ let tags = vec![
125
+ TagValue::FunctionName(FunctionName(function_name.to_string())),
126
+ TagValue::Status(status.clone()),
127
+ ];
128
+
129
+ if let Err(e) = pipeline.count(WellKnownMetricName::FunctionCallDequeued, 1.0, tags.clone()) {
127
130
  warn!(error = %e, function = %function_name, "failed to emit FunctionCallDequeued metric");
128
131
  }
132
+
133
+ if let Err(e) = pipeline.histogram(
134
+ WellKnownMetricName::FunctionCallProcessingLatency,
135
+ elapsed.as_secs_f64() * 1000.0,
136
+ tags,
137
+ ) {
138
+ warn!(error = %e, function = %function_name, "failed to emit FunctionCallProcessingLatency metric");
139
+ }
129
140
  }
@@ -30,7 +30,7 @@
30
30
 
31
31
  use std::panic::AssertUnwindSafe;
32
32
  use std::sync::{Arc, Mutex};
33
- use std::time::Duration;
33
+ use std::time::{Duration, Instant};
34
34
 
35
35
  use chalk_queue::semaphore::renew_many;
36
36
  use chalk_queue::stream_writer;
@@ -404,6 +404,7 @@ async fn coalesced_execute_and_write(
404
404
  let ipc_bytes = work.call.feather_bytes()?;
405
405
  let function_name = work.call.name.clone();
406
406
  let metadata = work.metadata.otel_headers.clone();
407
+ let started = Instant::now();
407
408
 
408
409
  let _ = queue.update_status(call_uuid, "running").await;
409
410
  info!(call_id = %work.call_id, function = %function_name, "running coalesced queued call");
@@ -425,11 +426,11 @@ async fn coalesced_execute_and_write(
425
426
 
426
427
  let response = rx.recv().await;
427
428
 
428
- // Record the dequeue once the batch has produced this caller's result,
429
- // before the stream writes below — parity with the streaming path.
429
+ // Record metrics once the batch has produced this caller's result, before
430
+ // stream writes below — parity with the streaming path.
430
431
  let success = matches!(response, Some(Ok(_)));
431
432
  if let Some(p) = metrics_pipeline {
432
- crate::metrics::record_dequeue(p, &function_name, success);
433
+ crate::metrics::record_completed_call(p, &function_name, success, started.elapsed());
433
434
  }
434
435
 
435
436
  match response {
@@ -487,6 +488,7 @@ async fn execute_and_write(
487
488
  let ipc_bytes = work.call.feather_bytes()?;
488
489
  let function_name = work.call.name.clone();
489
490
  let metadata = work.metadata.otel_headers.clone();
491
+ let started = Instant::now();
490
492
 
491
493
  let _ = queue.update_status(call_uuid, "running").await;
492
494
  info!(call_id = %work.call_id, function = %function_name, "running queued call");
@@ -501,7 +503,7 @@ async fn execute_and_write(
501
503
  let buffer = ChunkBuffer::new().into_shared();
502
504
  let handler_fut = handler.call_into_buffer(
503
505
  ipc_bytes,
504
- function_name,
506
+ function_name.clone(),
505
507
  metadata,
506
508
  PEER.to_string(),
507
509
  buffer.clone(),
@@ -537,12 +539,11 @@ async fn execute_and_write(
537
539
  }
538
540
  };
539
541
 
540
- // Emit FunctionCallDequeued as soon as execution finishes before the
541
- // result-stream writes below so the dequeue metric is recorded for every
542
- // executed call regardless of any downstream Redis write failure. Mirrors
543
- // the catalog consumer's per-call emission.
542
+ // Emit metrics as soon as execution finishes, before result-stream writes,
543
+ // so every executed call is recorded regardless of downstream Redis write
544
+ // failure. Mirrors the catalog consumer's per-call emission.
544
545
  if let Some(p) = metrics_pipeline {
545
- crate::metrics::record_dequeue(p, &work.call.name, result.is_ok());
546
+ crate::metrics::record_completed_call(p, &function_name, result.is_ok(), started.elapsed());
546
547
  }
547
548
 
548
549
  // Flush whatever the handler produced after the loop exits (on the fast path
@@ -71,7 +71,7 @@ pub async fn run_server(
71
71
  #[cfg(target_os = "linux")]
72
72
  if let Some(cfg) = crate::self_consumer::SelfConsumerConfig::from_env() {
73
73
  // Build the chalk_metrics pipeline once (mirrors the fnq-server/cc
74
- // main init) so the self-consumer can emit FunctionCallDequeued.
74
+ // main init) so the self-consumer can emit function-call metrics.
75
75
  let pipeline = crate::metrics::init_pipeline().await;
76
76
  let consumer_handler = python_handler.clone();
77
77
  let consumer_coalescing = coalescing_queue.clone();
@@ -0,0 +1 @@
1
+ __version__ = "1.8.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalk-remote-call-python
3
- Version: 1.8.0
3
+ Version: 1.8.1
4
4
  Summary: Chalk remote call Python runtime interface client
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -1 +0,0 @@
1
- __version__ = "1.8.0"