Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Duration by Completed Span #521

Closed
kbrockhoff opened this issue Sep 4, 2019 · 6 comments
Closed

Expose Duration by Completed Span #521

kbrockhoff opened this issue Sep 4, 2019 · 6 comments

Comments

@kbrockhoff
Copy link
Member

Many development teams will want the ability to log or further process the duration of a particular remote call. It would be helpful to have this exposed by the public Span API.

@bogdandrutu
Copy link
Member

It is very interesting to me to understand why logging this when you have tracing (probably I don't understand very well the use-case). I am moving this to specs because this affects the public API capabilities.

@kbrockhoff
Copy link
Member Author

There are two use cases I can think of.

  1. When creating a MeasureBatchRecorder at the end of span, recording a duration value that exactly matches the duration being used by the tracing system.

  2. Application developers wanting to log duration along with other application specific info to their application's logs.

The typical enterprise developer will choose to write their own understanding layer rather than make the effort to understand how to use a framework as designed. Exposing this data will make it a little less tempting for them to write their own layer.

@kbrockhoff
Copy link
Member Author

I am thinking about how to write an enhancement proposal to enable optional recording of full message payloads. This will be important to enterprise developers wanting to prove that their team is not at fault for a particular issue. This is kind of the same category as use case number 2 above.

@bogdandrutu
Copy link
Member

We do have a duration exposed in the SDK but not in the API, is that enough to cover all your use-cases?

@kbrockhoff
Copy link
Member Author

My objective is to have the duration recorded for the span exactly match the duration pushed to the metrics system. The change to end span which enables passing in the end timestamp provides a solution. The process is to record a timestamp, pass it to end span and then subtract the captured start timestamp to calculate the duration to record a measurement for.

Fixed by #571

@bogdandrutu
Copy link
Member

Closing this as @kbrockhoff said is fixed. Consider to re-open if I made a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants