-
Notifications
You must be signed in to change notification settings - Fork 837
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
fix(basic-tracer): add timestamp for event #195
Conversation
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 93.59% 93.62% +0.02%
==========================================
Files 50 50
Lines 1578 1585 +7
Branches 99 99
==========================================
+ Hits 1477 1484 +7
Misses 101 101
|
@@ -79,7 +79,7 @@ export class Span implements types.Span, ReadableSpan { | |||
|
|||
addEvent(name: string, attributes?: types.Attributes): this { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also make an optional time
parameter for the event?
That will be helpful for bringing over the OpenCensus Web code since it generates timed events based on browser performance data (this is similar to my desire to make the start span take a start time and end span take an end time, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not defined in the specs: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-tracing.md#add-events. AFAIK SDK is responsible for adding timestamp internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, OK. Should I raise an issue with the specs for this? What's the process for that?
I do need the feature for web tracing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the event timestamp is gonna be different from current timestamp (which we are adding internally) in web tracing?
What's the process for that?
Create new issue here and start the discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointer! I've created open-telemetry/opentelemetry-specification#213 to discuss and shared more about the web tracing use case there (basically generating timed events from Performance API data as measured by the browser runtime rather than in the JS code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh huh okay I think that part of the spandata removal is going to have to include optional timestamps for events, because how else would you do out of band reporting without the timestamp? I'll comment on that issue @draffensperger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the issue @draffensperger. If all goes well, I will open new PR to merge TimedEvent
and Event
interface and add optional timestamp param to addEvent
method. To unblock #192 work I'd like to merge this one. /cc @hekike
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on this given the current spec
Thanks! |
* fix: prefer import type, remove unneeded type and only import required type where applicable Signed-off-by: Naseem <naseem@transit.app> * fix: address cr -- import entire module rather than only used exports Signed-off-by: Naseem <naseem@transit.app>
Closes #191
originates from https://github.com/open-telemetry/opentelemetry-js/pull/192/files#diff-08ba7b60ae6ed103fba2d7664cff8c92R88