opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Fix: Don't pass ns for ms in timeout during metrics collection

Open martin-schulze-e2m opened this issue 1 year ago • 7 comments

Description

When nearing the collection deadline, the remaining time should be accurately passed is timeout to the callbacks. Once the deadline is closer than 10s, the remaining time in nanoseconds is passed to timeout_millis, which is expected to be in milliseconds, thus giving a timeout that is 10e6 times too large.

Type of change

Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

CI?

Does This PR Require a Contrib Repo Change?

No. (As far as I can tell.)

Checklist:

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

martin-schulze-e2m avatar Jun 10 '24 10:06 martin-schulze-e2m

CLA Missing ID CLA Not Signed

Good catch, care to sign the CLA and add a test? asserting that a mocked CallbackOptions that is called with the right value should be enough.

xrmx avatar Jun 10 '24 12:06 xrmx

Good catch, care to sign the CLA and add a test? asserting that a mocked CallbackOptions that is called with the right value should be enough.

I contacted our legal department regarding the CLA but cannot give an ETA when this will be resolved. After that I will have a look at the tests.

martin-schulze-e2m avatar Jun 10 '24 12:06 martin-schulze-e2m

I updated an existing test that had a wrong test expectation.

We are still working on getting the CLA signed but legal approved already.

I won't be available in the next few weeks so if more changes are required, you might need to be patient.

martin-schulze-e2m avatar Jun 20 '24 13:06 martin-schulze-e2m

@martin-schulze-e2m please use only the account that will have the CLA signed for every commit

xrmx avatar Jun 20 '24 13:06 xrmx

@xrmx I started this PR via the web ui and edited the second commit locally. I don't know how to consolidate that to only the "web account".

I tried to rebase and sign both with my GPG Key. Is that enough for EasyCLA?

martin-schulze-e2m avatar Jun 21 '24 06:06 martin-schulze-e2m

@martin-schulze-e2m We'll sort it out once we have a green tick from the CLA check

xrmx avatar Jun 21 '24 07:06 xrmx

I just wanted to let you know that this will take a while longer. Our designated CLA manager was not able to get the required signature before leaving until September.

martin-schulze-e2m avatar Jul 23 '24 07:07 martin-schulze-e2m

@martin-schulze-e2m would it be a problem for you if we will do a re-implementation since this is open since a few already?

xrmx avatar Jul 23 '24 08:07 xrmx

I just wanted to get this resolved and thought this was the fastest route. It turns out it was not.

Would it be a problem for you if we will do a re-implementation

I cannot speak for my employer, I am fine with that and would have had no problem with contributing this privately...

I hope we will eventually get the CLA sorted out to have a more streamlined experience the next time. :)

martin-schulze-e2m avatar Jul 23 '24 08:07 martin-schulze-e2m

@martin-schulze-e2m if you want to redo the contribution on your own time and personal account please do

xrmx avatar Jul 23 '24 08:07 xrmx

I am severely time constrained right now and meant: if I had known in advance that this would be an issue, I would have contributed under a different account.

Anyways I doubt that I can legally do a "clean room" design that will shield your org. I think a rewrite must come from someone else now.

I am sorry about the hassle.

martin-schulze-e2m avatar Jul 23 '24 08:07 martin-schulze-e2m

@martin-schulze-e2m don't worry

xrmx avatar Jul 23 '24 08:07 xrmx

Superseded by https://github.com/open-telemetry/opentelemetry-python/pull/4074/, thanks for spotting the issue and the initial attempt!

xrmx avatar Jul 24 '24 07:07 xrmx