Skip to content

Expose elapsed_ms in step.http_call output for latency measurement #381

@intel352

Description

@intel352

Summary

step.http_call does not currently expose the request duration in its output. We need an elapsed_ms field in the step output so pipelines can measure and log upstream latency.

Use Case

In a facade/proxy pattern with shadow mode, a pipeline calls two upstream services in parallel and logs divergence metrics including latency:

- name: call_primary
  type: step.http_call
  config:
    url: "https://primary-service/api/resource"
    method: GET

- name: call_shadow
  type: step.http_call
  config:
    url: "https://shadow-service/api/resource"
    method: GET

- name: log_divergence
  type: step.log
  config:
    level: info
    message: "primary_latency={{.steps.call_primary.elapsed_ms}}ms shadow_latency={{.steps.call_shadow.elapsed_ms}}ms"

Currently there is no way to access the request duration from step.http_call output, forcing workarounds like -1 sentinel values in latency metrics.

Proposed Behavior

  • Add elapsed_ms (int64, milliseconds) to step.http_call output alongside existing fields (status_code, body, headers)
  • Measured as wall-clock time from request send to response fully read
  • Available in pipeline context as steps.<step_name>.elapsed_ms

Context

This is a blocker for enabling shadow mode divergence logging in a multi-service migration. Without real latency values, divergence metrics are meaningless for capacity planning and performance comparison between services.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions