Componentize the remaining integration extensions (2nd part)#540
Componentize the remaining integration extensions (2nd part)#540
Conversation
| 'requests': 'opencensus.trace.ext.requests.trace', | ||
| 'google_cloud_clientlibs': 'opencensus.trace.ext.google_cloud_clientlibs.trace', # noqa | ||
| 'threading': 'opencensus.trace.ext.threading.trace', | ||
| SUPPORTED_INTEGRATIONS = ['httplib', 'mysql', 'postgresql', 'pymysql', |
There was a problem hiding this comment.
@c24t I wish to know your opinion on this.
This "config integration" seems to be introduced for:
- Frameworks such like Django which prefers configuration.
- Convenience, e.g. having settings.py file (or even environment variable) which can be updated easily.
From dependency perspective, this is like "reflection", the core package is "depending" on contrib packages.
There was a problem hiding this comment.
I would prefer to keep this feature, but refactor in the following way:
- remove hard-coded integration names.
- scan
opencensus.extnamespace, try to import the extensions. - log warning if module not found.
There was a problem hiding this comment.
That sounds like a good plan to me, although scanning installed packages may introduce some problems. Another complicating factor is that not every integration implements trace.trace_integration.
| session.install('-e', 'contrib/opencensus-ext-requests') | ||
| session.install('-e', 'contrib/opencensus-ext-sqlalchemy') | ||
| session.install('-e', 'contrib/opencensus-ext-threading') | ||
| session.install('-e', 'contrib/opencensus-ext-google-cloud-clientlibs') |
There was a problem hiding this comment.
Here we don't follow the alphabetic order since ext-google-cloud-clientlibs has dependency on ext-grpc and ext-requests.
Ideally we don't want to maintain the order here, just having someting like "install all the packages under contrib, let pip figure out the dependency, resolve package dependency from contrib folder before consulting PyPI". Currently I haven't figured out how to do this.
c24t
left a comment
There was a problem hiding this comment.
Can you remove wrapt from setup.py now that requests is out in its own package?
c24t
left a comment
There was a problem hiding this comment.
This LGTM, although we may need to revisit the maximum versions for contrib packages as we update the library. Glad to see all these packages moved!
Yep! I'll do the clean up in my next PR (clean up dependencies, move the samples). |
This PR follows the approach in #535 for the remaining extensions.
This is part of the effort for #445.