-
Notifications
You must be signed in to change notification settings - Fork 633
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 pymssql instrumentation #394
base: main
Are you sure you want to change the base?
Conversation
|
It seems from the CI logs that pymssql does not build for pypy3. Would it be acceptable to disable pypy3 support in the tests for this instrumentation? |
Also, the docs fails to build because of this error: sphinx.errors.SphinxWarning: autodoc: failed to import module 'pymssql' from module 'opentelemetry.instrumentation'; the following exception was raised: I'm trying to figure out my error, can someone experienced with the repo help? |
0860e38
to
92d7340
Compare
I had to subclass |
def wrapped_connection( | ||
self, | ||
connect_method: typing.Callable[..., typing.Any], | ||
args: typing.Tuple[typing.Any, typing.Any], |
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.
The typing is wrong here, need a variable number of arguments in the tuple.
92d7340
to
faeea0a
Compare
|
0e2df03
to
b93ad00
Compare
@guillaumep |
@lzchen I was expecting help with the issues I mentioned in the comments above, but since I never got any replies up to now I had put this work aside. pymssql instrumention is still a feature we want at work (outbox.com), so if I can have proper support regarding my questions I'll be glad to finish this PR. Let me rebase the PR this week and post back here with the current issues I will have. |
@guillaumep |
17d054f
to
0333424
Compare
|
96980a5
to
4cc4753
Compare
@@ -119,6 +119,10 @@ envlist = | |||
py3{7,8,9,10}-test-instrumentation-pymongo | |||
pypy3-test-instrumentation-pymongo | |||
|
|||
; opentelemetry-instrumentation-pymssql | |||
py3{7,8,9,10}-test-instrumentation-pymssql | |||
; instrumentation-pymssql intentionally excluded from pypy3 |
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.
pymssql has no pypy support:
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.
If you could add that link in the file as a comment that'd be good.
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.
Please link this in the tox file.
@lzchen now ready for review! |
@guillaumep |
...n/opentelemetry-instrumentation-pymssql/src/opentelemetry/instrumentation/pymssql/package.py
Outdated
Show resolved
Hide resolved
Please add an entry to the README |
.../opentelemetry-instrumentation-pymssql/src/opentelemetry/instrumentation/pymssql/__init__.py
Outdated
Show resolved
Hide resolved
.../opentelemetry-instrumentation-pymssql/src/opentelemetry/instrumentation/pymssql/__init__.py
Outdated
Show resolved
Hide resolved
cnx.close() | ||
|
||
API | ||
--- |
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.
Please add a section for configuration like here
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.
Is this done? tracer_provider
can still be configured.
https://github.com/pymssql/pymssql/ | ||
""" | ||
tracer_provider = kwargs.get("tracer_provider") | ||
|
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.
Are request_hook
and response_hook
going to be supported?
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 based my code on pymysql which does not support these hooks. Can we consider this an improvement request that could be done in a future PR?
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.
That's fine. Could you create a new issue to track this to be done?
.../opentelemetry-instrumentation-pymssql/src/opentelemetry/instrumentation/pymssql/__init__.py
Show resolved
Hide resolved
@lzchen currently working on the comments. Would you prefer I rebase, modify my current commit and force push on my branche, or would you rather like to have a new commit that addresses the comments? |
4a114eb
to
9d87d8e
Compare
9d87d8e
to
22363db
Compare
@lzchen All comments addressed. |
Changes look good. Just a couple of outstanding comments. Also please fix the builds :) |
@guillaumep we are almost near to getting this merged. Please fix the tests and address the outstanding comments. |
OpenTelemetry pymssql Instrumentation | ||
===================================== | ||
|
||
.. automodule:: opentelemetry.instrumentation.pymssql |
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.
Pls add the relevant needed pymssql version to docs-requirements.txt - This can be verified using tox -e docs
@@ -68,6 +68,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
- `opentelemetry-instrumentation-confluent-kafka` Add support for the latest versions of the library. | |||
([#1468](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1468)) | |||
|
|||
### Added |
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.
Please move this to the Unreleased section
Description
This pull request implements instrumentation for the pymssql library (https://pypi.org/project/pymssql/).
It is basically a copy of the pymysql instrumentation.
Still a work-in-progress.
Type of change
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.