-
Notifications
You must be signed in to change notification settings - Fork 81
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 the logfire.instrument_mysql()
#341
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #341 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 119 121 +2
Lines 8895 8947 +52
Branches 1159 1162 +3
=========================================
+ Hits 8895 8947 +52 ☔ View full report in Codecov by Sentry. |
@Kludex Could you please review the PR ? |
logfire.instrument_mysql()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this integration, you can also instrument a single connection.
@alexmojaki Can you confirm we want this to be analogous to psycopg?
We do want that, but I don't know if that needs to block this PR. |
@Kludex @alexmojaki I will update this PR instrumenting single MySQL connection, as this is not an urgent required changes |
9363b75
to
f62646d
Compare
@Kludex updated the PR, Could you please review ? |
f2a8098
to
e3449ee
Compare
Hi @alexmojaki , resolved the comments. Could you please review ? |
e3449ee
to
f54ff68
Compare
@alexmojaki Could you please review the changes ? |
Args: | ||
conn: The `mysql` connection to instrument, or `None` to instrument all connections. | ||
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | ||
|
||
Returns: | ||
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Args: | |
conn: The `mysql` connection to instrument, or `None` to instrument all connections. | |
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | |
Returns: | |
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. We have something similar in instrument_psycopg. All of this is useful, especially the fact that it returns an instrumented connection.
|
||
Args: | ||
conn: The MySQL connection to instrument. If None, the entire `mysql` module is instrumented. | ||
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | ||
|
||
Returns: | ||
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Args: | |
conn: The MySQL connection to instrument. If None, the entire `mysql` module is instrumented. | |
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | |
Returns: | |
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. |
|
||
Args: | ||
conn: The `mysql` connection to instrument, or `None` to instrument all connections. | ||
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | ||
|
||
Returns: | ||
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Args: | |
conn: The `mysql` connection to instrument, or `None` to instrument all connections. | |
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | |
Returns: | |
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. |
|
||
Args: | ||
conn: The MySQL connection to instrument. If None, the entire `mysql` module is instrumented. | ||
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | ||
|
||
Returns: | ||
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Args: | |
conn: The MySQL connection to instrument. If None, the entire `mysql` module is instrumented. | |
**kwargs: Additional keyword arguments to pass to the OpenTelemetry `instrument` methods. | |
Returns: | |
If a connection is provided, returns the instrumented connection. If no connection is provided, returns None. |
33d21bb
to
616837a
Compare
@Kludex please check this comment #341 (comment) |
Thanks @aditkumar72 🙏 |
Fixes #310