-
Notifications
You must be signed in to change notification settings - Fork 213
Add utility classes and tests for Timer and Attribute tracking by id … #1614
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
base: main
Are you sure you want to change the base?
Add utility classes and tests for Timer and Attribute tracking by id … #1614
Conversation
…and object Introduced `TimerTrackerById`, `TimerTrackerByObject`, `AttributeTrackerById`, and `AttributeTrackerByObject` classes for managing timers and attributes based on id or object references. This will be used by auto instrumentation and metrics in contrib modules.
|
For any time related operations, there's also already clock functionality in the API - so it might make sense to utilise that over the raw calls to microtime. |
@brettmc Usage example is here: open-telemetry/opentelemetry-php-contrib#391 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi @brettmc , somehow I missed this notification :/
For example: TimerTrackerById would keep timers for everything that sending external requests: PDO, Redis, HttpClient, Curl, Guzzle etc. Everything that needs to get duration.
Instance of a tracker would be created in
Well we can copy and paste those classes all over but that would also be a bad practice. Maybe some form of cross contrib code share? We could do some namespace shenanigans and have shared code just copied to a contrib module? "autoload": {
"psr-4": {
"OpenTelemetry\\Contrib\\Instrumentation\\PDO\\": "src/"
},
"files": [
"_register.php"
]
}, to "autoload": {
"psr-4": {
"OpenTelemetry\\Contrib\\Instrumentation\\PDO\\": "src/",
"OpenTelemetry\\Contrib\\Instrumentation\\Shared\\": "shared/"
},
"files": [
"_register.php"
]
}, Or even put everything into one file and use |
Agreed, that sounds awful! The most likely place is its own package in contrib, or in our API. If it goes into API, then under |
…and object
Introduced
TimerTrackerById
,TimerTrackerByObject
,AttributeTrackerById
, andAttributeTrackerByObject
classes for managing timers and attributes based on id or object references.This will be used by auto instrumentation and metrics in contrib modules.