Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
Use published signalfx-instrumenation-* packages instead of github ta…
Browse files Browse the repository at this point in the history
…rballs
  • Loading branch information
owais committed Jan 25, 2021
1 parent b842d77 commit a568269
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 58 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,24 @@ Log injection is not enabled by default and can be enabled by setting `SIGNALFX_

| Library/Framework | Instrumentation Package |
| ----------------- | ----------------------- |
| celery | https://github.com/signalfx/python-celery/tarball/0.0.1post0#egg=celery-opentracing |
| django | https://github.com/signalfx/python-django/tarball/0.1.18post1#egg=django-opentracing |
| elasticsearch | https://github.com/signalfx/python-elasticsearch/tarball/0.1.4post#egg=elasticsearch-opentracing |
| flask | https://github.com/signalfx/python-flask/tarball/1.1.0post1#egg=flask_opentracing### |
| psycopg | https://github.com/signalfx/python-dbapi/tarball/v0.0.5post2#egg=dbapi-opentracing |
| pymongo | https://github.com/signalfx/python-pymongo/tarball/v0.0.3post1#egg=pymongo-opentracing |
| pymysql | https://github.com/signalfx/python-dbapi/tarball/v0.0.5post2#egg=dbapi-opentracing |
| redis | https://github.com/signalfx/python-redis/tarball/v1.0.0post1#egg=redis-opentracing |
| requests | https://github.com/signalfx/python-requests/archive/v0.2.0post2.zip#egg=requests-opentracing |
| tornado | https://github.com/signalfx/python-tornado/archive/1.0.1post1.zip#egg=tornado_opentracing |
| celery | signalfx-instrumentation-celery |
| django | signalfx-instrumentation-django |
| elasticsearch | signalfx-instrumentation-elasticsearch |
| flask | signalfx-instrumentation-flask |
| psycopg | signalfx-instrumentation-dbapi |
| pymongo | signalfx-instrumentation-pymongo |
| pymysql | signalfx-instrumentation-dbapi |
| redis | signalfx-instrumentation-redis |
| requests | signalfx-instrumentation-requests |
| tornado | signalfx-instrumentation-tornado |


### Example

If your Python app is using flask and you want to install flask instrumentation, you'd have to run

```
pip install https://github.com/signalfx/python-flask/tarball/1.1.0post1#egg=flask_opentracing
pip install signalfx-instrumentation-flask
```

or add the package to your `requirements.txt` file.
18 changes: 9 additions & 9 deletions requirements-inst.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
git+https://github.com/signalfx/python-celery.git@0.0.1post0#egg=celery-opentracing
git+https://github.com/signalfx/python-dbapi.git@v0.0.5post2#egg=dbapi-opentracing
git+https://github.com/signalfx/python-django.git@0.1.18post1#egg=django-opentracing
git+https://github.com/signalfx/python-elasticsearch.git@0.1.4post1#egg=elasticsearch-opentracing
git+https://github.com/signalfx/python-flask.git@1.1.0post1#egg=flask_opentracing
git+https://github.com/signalfx/python-pymongo.git@v0.0.3post1#egg=pymongo-opentracing
git+https://github.com/signalfx/python-redis.git@v1.0.0post1#egg=redis-opentracing
git+https://github.com/signalfx/python-requests.git@v0.2.0post2#egg=requests-opentracing
git+https://github.com/signalfx/python-tornado.git@1.0.1post1#egg=tornado_opentracing
signalfx-instrumentation-celery
signalfx-instrumentation-dbapi
signalfx-instrumentation-django
signalfx-instrumentation-elasticsearch
signalfx-instrumentation-flask
signalfx-instrumentation-pymongo
signalfx-instrumentation-redis
signalfx-instrumentation-requests
signalfx-instrumentation-tornado
sfx-jaeger-client>=3.13.1b0.dev5
57 changes: 36 additions & 21 deletions scripts/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,47 @@ def is_installed(library):

jaeger_client = 'sfx-jaeger-client>=3.13.1b0.dev5'

old_instrumentors = [
'elasticsearch-opentracing',
'celery-opentracing',
'django-opentracing',
'Flask-Opentracing',
'dbapi-opentracing',
'pymongo-opentracing',
'dbapi-opentracing',
'redis-opentracing',
'requests-opentracing',
'tornado-opentracing',
]

# target library to desired instrumentor path/versioned package name
instrumentors = {
'celery': 'https://github.com/signalfx/python-celery/tarball/0.0.1post0#egg=celery-opentracing',
'django': 'https://github.com/signalfx/python-django/tarball/0.1.18post1#egg=django-opentracing',
'elasticsearch': ('https://github.com/signalfx/python-elasticsearch/tarball/0.1.4post1'
'#egg=elasticsearch-opentracing'),
'flask': 'https://github.com/signalfx/python-flask/tarball/1.1.0post1#egg=flask_opentracing',
'psycopg2': 'https://github.com/signalfx/python-dbapi/tarball/v0.0.5post2#egg=dbapi-opentracing',
'pymongo': 'https://github.com/signalfx/python-pymongo/tarball/v0.0.3post1#egg=pymongo-opentracing',
'pymysql': 'https://github.com/signalfx/python-dbapi/tarball/v0.0.5post2#egg=dbapi-opentracing',
'redis': 'https://github.com/signalfx/python-redis/tarball/v1.0.0post1#egg=redis-opentracing',
'requests': 'https://github.com/signalfx/python-requests/archive/v0.2.0post2.zip#egg=requests-opentracing',
'tornado': 'https://github.com/signalfx/python-tornado/archive/1.0.1post1.zip#egg=tornado_opentracing',
'celery': 'signalfx-instrumentation-celery>=1.0.0',
'django': 'signalfx-instrumentation-django>=1.0.0',
'elasticsearch': 'signalfx-instrumentation-elasticsearch>=1.0.0',
'flask': 'signalfx-instrumentation-flask>=1.0.0',
'psycopg2': 'signalfx-instrumentation-dbapi>=1.0.0',
'pymongo': 'signalfx-instrumentation-pymongo>=1.0.0',
'pymysql': 'signalfx-instrumentation-dbapi>=1.0.0',
'redis': 'signalfx-instrumentation-redis>=1.0.0',
'requests': 'signalfx-instrumentation-requests>=1.0.0',
'tornado': 'signalfx-instrumentation-tornado>=1.0.0',
}

# relevant instrumentors and tracers to uninstall and check for conflicts for target libraries
packages = {
'celery': ('celery-opentracing',),
'django': ('django-opentracing',),
'elasticsearch': ('elasticsearch-opentracing',),
'flask': ('Flask-OpenTracing',),
'celery': ('signalfx-instrumentation-celery',),
'django': ('signalfx-instrumentation-django',),
'elasticsearch': ('signalfx-instrumentation-elasticsearch',),
'flask': ('signalfx-instrumentation-flask',),
'jaeger': ('sfx-jaeger-client', 'jaeger-client'),
'psycopg2': ('dbapi-opentracing',),
'pymongo': ('pymongo-opentracing',),
'pymysql': ('dbapi-opentracing',),
'redis': ('redis-opentracing',),
'requests': ('requests-opentracing',),
'psycopg2': ('signalfx-instrumentation-dbapi',),
'pymongo': ('signalfx-instrumentation-pymongo',),
'pymysql': ('signalfx-instrumentation-dbapi',),
'redis': ('signalfx-instrumentation-redis',),
'requests': ('signalfx-instrumentation-requests',),
'signalfx-tracing': ('signalfx-tracing',),
'tornado': ('tornado-opentracing',),
'tornado': ('signalfx-instrumentation-tornado',),
}


Expand Down Expand Up @@ -74,6 +85,10 @@ def _install_updated_dependency(library, package_path, target=None):
if '{}=='.format(package).lower() in pip_list:
print('Existing {} installation detected. Uninstalling.'.format(package))
subprocess.check_call([sys.executable, '-m', 'pip', 'uninstall', '-y', package])
for package in old_instrumentors:
if '{}=='.format(package).lower() in pip_list:
print('Found deprecated instrumentor {}. Uninstalling.'.format(package))
subprocess.check_call([sys.executable, '-m', 'pip', 'uninstall', '-y', package])

# explicit upgrade strategy to override potential pip config
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-U',
Expand Down
22 changes: 11 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@ def extras_require(lib):
setup_args['extras_require'] = dict(
unit_tests=unit_test_requirements,
instrumentation_tests=instrumentation_test_requirements,
celery=extras_require('celery-opentracing'),
dbapi=extras_require('dbapi-opentracing'),
django=extras_require('django-opentracing'),
elasticsearch=extras_require('elasticsearch-opentracing'),
flask=extras_require('flask_opentracing'),
celery=extras_require('signalfx-instrumentation-celery'),
dbapi=extras_require('signalfx-instrumentation-dbapi'),
django=extras_require('signalfx-instrumentation-django'),
elasticsearch=extras_require('signalfx-instrumentation-elasticsearch'),
flask=extras_require('signalfx-instrumentation-flask'),
jaeger=extras_require('sfx-jaeger-client'),
psycopg2=extras_require('dbapi-opentracing'),
pymongo=extras_require('pymongo-opentracing'),
pymysql=extras_require('dbapi-opentracing'),
redis=extras_require('redis-opentracing'),
requests=extras_require('requests-opentracing'),
tornado=extras_require('tornado_opentracing')
psycopg2=extras_require('signalfx-instrumentation-dbapi'),
pymongo=extras_require('signalfx-instrumentation-pymongo'),
pymysql=extras_require('signalfx-instrumentation-dbapi'),
redis=extras_require('signalfx-instrumentation-redis'),
requests=extras_require('signalfx-instrumentation-requests'),
tornado=extras_require('signalfx-instrumentation-tornado')
)

setup(**setup_args)
2 changes: 1 addition & 1 deletion signalfx_tracing/libraries/django_/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Django

- [opentracing-contrib/python-django](https://github.com/opentracing-contrib/python-django)
- [signalfx/python-django](https://github.com/signalfx/python-django)
- [Official Site](https://www.djangoproject.com)

The SignalFx Auto-instrumentor configures the OpenTracing Project's Django instrumentation for your Django 1.x or
Expand Down
2 changes: 1 addition & 1 deletion signalfx_tracing/libraries/elasticsearch_/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Elasticsearch

- [opentracing-contrib/python-elasticsearch](https://github.com/opentracing-contrib/python-elasticsearch)
- [signalfx/python-elasticsearch](https://github.com/signalfx/python-elasticsearch)
- [Official Site](https://www.elastic.co/products/elasticsearch)

The SignalFx Auto-instrumentor configures the OpenTracing Project's Elasticsearch instrumentation for your Elasticsearch
Expand Down
2 changes: 1 addition & 1 deletion signalfx_tracing/libraries/flask_/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flask

- [opentracing-contrib/python-flask](https://github.com/opentracing-contrib/python-flask)
- [signalfx/python-flask](https://github.com/signalfx/python-flask)
- [Official Site](http://flask.pocoo.org)

The SignalFx Auto-instrumentor configures the OpenTracing Project's Flask instrumentation for your Flask 0.10+
Expand Down
2 changes: 1 addition & 1 deletion signalfx_tracing/libraries/redis_/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Redis

- [opentracing-contrib/python-redis](https://github.com/opentracing-contrib/python-redis)
- [signalfx/python-redis](https://github.com/signalfx/python-redis)
- [Official Site](https://redis.io/)

The SignalFx Auto-instrumentor configures the OpenTracing Redis-Py instrumentation for your 2.10+ `StrictRedis`
Expand Down
2 changes: 1 addition & 1 deletion signalfx_tracing/libraries/tornado_/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tornado

- [opentracing-contrib/python-tornado](https://github.com/opentracing-contrib/python-tornado)
- [signalfx/python-tornado](https://github.com/signalfx/python-tornado)
- [Official Site](http://www.tornadoweb.org)

The SignalFx Auto-instrumentor configures the OpenTracing Project's Tornado instrumentation for your Tornado 4.x
Expand Down
2 changes: 1 addition & 1 deletion signalfx_tracing/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright (C) 2018-2020 SignalFx. All rights reserved.

__version__ = '1.6.6'
__version__ = '2.0.0'

0 comments on commit a568269

Please sign in to comment.