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

feat(core): add seconds converter utility #4945

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ZY-Ang
Copy link

@ZY-Ang ZY-Ang commented Aug 22, 2024

Which problem is this PR solving?

api.HrTime has no utility to convert to float seconds for http.server.request.duration and http.client.request.duration semantic conventions.

Short description of the changes

Minor addition of a utility for another PR that uses that utility. Simply converts api.HrTime to seconds.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • #hrTimeToSeconds unit test

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@ZY-Ang ZY-Ang requested a review from a team August 22, 2024 07:37
@pichlermarc pichlermarc changed the title feat(instrumentation): add seconds converter utility feat(core): add seconds converter utility Aug 22, 2024
@dyladan
Copy link
Member

dyladan commented Aug 22, 2024

This looks good. Are you working on a PR to update the metric semconv for the http instrumentation?

@ZY-Ang
Copy link
Author

ZY-Ang commented Aug 23, 2024

This looks good. Are you working on a PR to update the metric semconv for the http instrumentation?

Can look into it.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@dyladan
Copy link
Member

dyladan commented Aug 23, 2024

This looks good. Are you working on a PR to update the metric semconv for the http instrumentation?

Can look into it.

I was just asking. The PR description mentions this is "Minor addition of a utility for another PR that uses that utility." so I was wondering what the other PR is.

@dyladan
Copy link
Member

dyladan commented Aug 23, 2024

I'm asking for 2 reasons

  1. I'm working on updating the http instrumentation right now so I want to make sure we don't duplicate work
  2. I don't think we should merge this PR for an unused utility until we know what it will be used for.

edit: if you want to work on updating the http instrumentation for metrics that's fine. I've opened a PR for client traces and I have server traces completed but no PR opened yet. I started working on metrics but didn't get as far.

@ZY-Ang
Copy link
Author

ZY-Ang commented Aug 23, 2024

@dyladan go ahead, do you have a link for visibility?

the utility is for converting the HR time to seconds. You’ll notice the current usage of the milliseconds version in the http instrumentation. If we can get this merged in, you just might be able to use it in your PR

@dyladan
Copy link
Member

dyladan commented Aug 23, 2024

@dyladan go ahead, do you have a link for visibility?

the utility is for converting the HR time to seconds. You’ll notice the current usage of the milliseconds version in the http instrumentation. If we can get this merged in, you just might be able to use it in your PR

Open PR for client traces here: #4940

Still in draft because I'm finishing up testing.

I'm asking what the motivation is for this PR. You mention in the description that this enables another PR but you don't say what that PR is.

@ZY-Ang
Copy link
Author

ZY-Ang commented Aug 23, 2024

@dyladan yours is way more refined. I thought no one was working on it. Please don’t let this hold you up. I will wait for your stable semconv implementation with earnest

@pichlermarc
Copy link
Member

@dyladan are you planning to use this for the semconv update in the http instrumentation? 🤔
It adds to the public interface of @opentelemetry/core so I'd like to be extra-sure that we will use this 🙂

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.

4 participants