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

Allow user to specify start time #94

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

rdooley
Copy link
Contributor

@rdooley rdooley commented Mar 26, 2024

@rdooley rdooley marked this pull request as ready for review March 26, 2024 16:18
@@ -23,13 +23,13 @@ local mt = {
-- config.attributes: span attributes
-- @return span
------------------------------------------------------------------
function _M.new(tracer, parent_ctx, ctx, name, config)
function _M.new(tracer, parent_ctx, ctx, name, config, start_time)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add arg to docstring above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh of course, great catch

@rdooley
Copy link
Contributor Author

rdooley commented Mar 26, 2024

how did the test pass because I forgot to alter the tracer.start method in the original commit? 🤔

@rdooley
Copy link
Contributor Author

rdooley commented Mar 26, 2024

This i think needs some work, I will do additional lua unit testing as well

* only use for recording spans
* yangxikun#86
@@ -36,6 +36,8 @@ describe("encode_spans", function()
local resource = encoded.resource_spans[1]
assert(#resource.instrumentation_library_spans == 1)
assert(#resource.instrumentation_library_spans[1].spans == 10)
assert(resource.instrumentation_library_spans[1].spans[1].start_time_unix_nano == "123456788")
assert(resource.instrumentation_library_spans[1].spans[1].end_time_unix_nano == "123456789")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a nice addition here to check that we are setting and exporting the times we expect on spans

lib/opentelemetry/trace/tracer.lua Outdated Show resolved Hide resolved
Co-authored-by: Sam <370182+plantfansam@users.noreply.github.com>
@yangxikun yangxikun merged commit f72ebd3 into yangxikun:main Apr 5, 2024
4 checks passed
@rdooley rdooley mentioned this pull request Apr 23, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants