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

Laravel: decoupled from SDK ClockFactory (& some linting) #211

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

ChrisLightfootWild
Copy link
Contributor

OpenTelemetry\SDK is used in the QueryWatcher instrumentation, so has been promoted from a dev dependency.

@ChrisLightfootWild ChrisLightfootWild requested a review from a team November 16, 2023 15:08
@@ -12,17 +12,15 @@
"ext-json": "*",
"ext-opentelemetry": "*",
"laravel/framework": ">=6.0",
"open-telemetry/api": "^1.0.0beta10",
"open-telemetry/api": "^1.0",
"open-telemetry/sdk": "^1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required for:

use OpenTelemetry\SDK\Common\Time\ClockFactory;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a way for it to not directly use the SDK? The OTEL spec is fairly firm about it: https://opentelemetry.io/docs/specs/otel/library-guidelines/#requirements

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing it out, I was not aware. Given that rule, it looks like the current implementation might be best in not using the ClockFactory, if possible?

I shall take a look at removing that coupling.

Copy link
Contributor Author

@ChrisLightfootWild ChrisLightfootWild Nov 16, 2023

Choose a reason for hiding this comment

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

@brettmc I've made changes to decouple from the SDK implementation here: 96038b7

Would there be a better place to consider housing the ClockInterface etc?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm happy with your changes. We could maybe move ClockInterface into the API (since it has some constants that might make that code a little more readable), but it's a pretty minor use-case and nothing else in contrib needs if, AFAICT.

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Merging #211 (d43ffce) into main (0152175) will not change coverage.
The diff coverage is 0.00%.

❗ Current head d43ffce differs from pull request most recent head 96038b7. Consider uploading reports for the commit 96038b7 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #211   +/-   ##
=========================================
  Coverage     33.08%   33.08%           
  Complexity      853      853           
=========================================
  Files            76       76           
  Lines          3252     3252           
=========================================
  Hits           1076     1076           
  Misses         2176     2176           
Flag Coverage Δ
7.4 46.34% <ø> (ø)
8.0 33.01% <0.00%> (ø)
8.1 33.04% <0.00%> (ø)
8.2 33.03% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...trumentation/Laravel/src/Watchers/QueryWatcher.php 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0152175...96038b7. Read the comment docs.

…rom the runtime dependency on the ClockFactory.
@ChrisLightfootWild ChrisLightfootWild changed the title Laravel: fix composer SDK depencency (& lint) Laravel: decoupled from SDK ClockFactory (& some linting) Nov 16, 2023
@brettmc brettmc merged commit 8665109 into open-telemetry:main Nov 17, 2023
58 checks passed
@ChrisLightfootWild ChrisLightfootWild deleted the dev/laravel/composer branch November 17, 2023 07:07
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.

2 participants