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

Add request param to EndTimeExtractor #3947

Conversation

mateuszrzeszutek
Copy link
Member

Sometimes there's no response and we use Void, and sometimes the request type is stateful and keeps all the info - it's useful to have it in the EndTimeExtractor too.

@@ -36,7 +36,8 @@
Instrumenter.<MessageWithDestination, Void>newBuilder(
otel, INSTRUMENTATION_NAME, spanNameExtractor)
.addAttributesExtractor(attributesExtractor)
.setTimeExtractors(MessageWithDestination::getStartTime, response -> Instant.now())
.setTimeExtractors(
MessageWithDestination::getStartTime, (request, response) -> Instant.now())
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe not related to this PR, is this supposed to be using nanoTime?

Copy link
Member Author

Choose a reason for hiding this comment

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

It probably should -- I think it was using just System.currentTimeMillis()before the Instrumenter refactoring. I'll change that to take nanos into account in the next PR.

@mateuszrzeszutek mateuszrzeszutek force-pushed the instrumenter-api-EndTimeExtractor branch from 3b0e0bb to bdadd5b Compare August 27, 2021 09:20
@mateuszrzeszutek mateuszrzeszutek merged commit 585cc55 into open-telemetry:main Aug 27, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the instrumenter-api-EndTimeExtractor branch August 27, 2021 12:42
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.

5 participants