Skip to content

trace: Support overriding step duration using a field #352

Open

Description

@dashpole

Is your feature request related to a problem?/Why is this needed

While implementing aggregated trace events for streaming in kubernetes/kubernetes#138873, we found it would be helpful to be able to explicitly pass the duration to the trace library: kubernetes/kubernetes#138873 (comment)

Describe the solution you'd like in detail

When the duration key is provided to trace.Step(), omit it from the printed fields, and instead use its value for the step duration.

Instead of:

Trace[195300817]:  ---"Compress" size:131088,count:1,duration:3.5321ms,parallel:true 0ms (20:36:57.082)]

After

Trace[195300817]:  ---"Compress" size:131088,count:1,parallel:true 3.5321ms (20:36:57.082)]

Describe alternatives you've considered

  • Just leave it as-is. The 0ms might be confusing for readers.
  • Support explicitly passing the duration as a parameter to Step() (probably using a new function)

@serathius @richabanker

Activity

  1. k8s-triage-robot commented on Oct 17, 2026

    @k8s-triage-robot

    The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

    This bot triages un-triaged issues according to the following rules:

    • After 90d of inactivity, lifecycle/stale is applied
    • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
    • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

    You can:

    • Mark this issue as fresh with /remove-lifecycle stale
    • Close this issue with /close
    • Offer to help out with Issue Triage

    Please send feedback to sig-contributor-experience at kubernetes/community.

    /lifecycle stale

  2. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions