Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Add LogRecord API from Go client #43

Merged
merged 3 commits into from
Jan 4, 2018
Merged

Conversation

isaachier
Copy link
Contributor

@isaachier isaachier commented Dec 7, 2017

Fix for #35

@rnburn
Copy link
Contributor

rnburn commented Dec 7, 2017

@isaachier - Do you think it would make sense to also be able to log these directly on the span? (I know Go only supports it as part of FinishSpanOptions.)

But I'm ok starting with it as part of FinishSpanOptions since we could always add that later.

// and <= the finish_steady_timestamp converted to steady timestamp
// (or SystemTime::now() if finish_steady_timestamp is default-constructed).
// Otherwise the behavior of FinishWithOptions() is undefined.
std::vector<LogRecord> log_records;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change this to unspecified behavior?

Also,

// and <= the finish_steady_timestamp converted to steady timestamp

I think you mean converted to system timestamp here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, my mistake.

@isaachier
Copy link
Contributor Author

I was thinking the same thing but the Go version may do that logic intentionally. For example, if I log a record A, then add B and C in the FinishSpanOptions, does the implementation append those, and if so, are they appended to the end or sorted based on timestamp? For that reason, it may be worthwhile to stick to one approach unless those questions are resolved.

@yurishkuro
Copy link
Member

my advice is to keep api simple, don't introduce features nobody asked for.

@rnburn
Copy link
Contributor

rnburn commented Jan 3, 2018

@isaachier -- could you fix the comments for this so that we can merge this in?

@isaachier
Copy link
Contributor Author

Sorry yes will do now.

// be set explicitly). Also, they must be >= the Span's start system timestamp
// and <= the finish_steady_timestamp converted to system timestamp
// (or SystemTime::now() if finish_steady_timestamp is default-constructed).
// Otherwise the behavior of FinishWithOptions() is undefined.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Otherwise the behavior of FinishWithOptions() is undefined.

Can we change this to unspecified or remove that line. Undefined behavior would mean a tracer is free to do anything (abort, segfault, etc). Given that converting between steady and system time is a noisy process, I don't think it would be right for a tracer to abort or corrupt the process if a timestamp is out of bounds.

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

Successfully merging this pull request may close these issues.

3 participants