Commit Graph

1810 Commits

Author SHA1 Message Date
joshuahlang 35f1e5bbdf aiohttp: aiohttp client (#421)
Adding initial aiohttp client.

This module is only supported on Python3.5, which is the oldest supported by
aiohttp.

Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-05-06 20:40:47 -07:00
joshuahlang d551cc354b aiohttp: aiohttp client (#421)
Adding initial aiohttp client.

This module is only supported on Python3.5, which is the oldest supported by
aiohttp.

Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-05-06 20:40:47 -07:00
Diego Hurtado 988962d24e Add Django instrumentation (#593)
Initial Instrumentation

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: Mathieu Hinderyckx <mathieu.hinderyckx@gmail.com>
Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-05-06 15:27:01 -07:00
Mauricio Vásquez da77a731d8 requests: Rename http_requests to requests (#619)
The requests integration is named http-requests because at the time it was created there were some problems with pylint. 

other integrations are using opentelemetry.ext.integration without problems, tests are passing without issue, even renamed.
2020-05-02 21:31:15 -07:00
Mauricio Vásquez ba030be66d requests: Rename http_requests to requests (#619)
The requests integration is named http-requests because at the time it was created there were some problems with pylint. 

other integrations are using opentelemetry.ext.integration without problems, tests are passing without issue, even renamed.
2020-05-02 21:31:15 -07:00
Mauricio Vásquez d9ad59bdbf Docs: fix docs dependencies (#625) 2020-04-30 16:35:15 -07:00
Mauricio Vásquez 4d7e590fa9 ext/pymysql: Add Instrumentor (#611)
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2020-04-29 14:30:58 -07:00
alrex b199df399f Porting sqlalchemy instrumentation from contrib repo (#591)
Porting the existing sqlalchemy instrumentation from
https://github.com/open-telemetry/opentelemetry-python-contrib/tree/master/reference/ddtrace/contrib/sqlalchemy

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-04-29 13:43:56 -07:00
alrex 0c36640dbc infra: reduce build time by running longest job early (#626)
Currently builds take roughly 15 minutes, as the longest job (pypy3) isn't
kicked off until one of the other jobs is finished running (max 5 concurrent
jobs). Prioritizing the longer jobs first should reduce the build time by about
5 minutes.
2020-04-29 13:16:45 -07:00
Mauricio Vásquez d3e3dbdcab ext/pymongo: Add instrumentor (#612)
The current Pymongo integration uses the monitoring.register() [1] to hook
the different internal calls of Pymongo. This integration doesn't allow to
unregister a monitor. This commit workaround that limitation by adding an
enable flag to the CommandTracer class and adds a logic to disable the
integration.  This solution is not perfect becasue there will be some overhead
even when the instrumentation is disabled, but that's what we can do with
the current approach.

[1] https://api.mongodb.com/python/current/api/pymongo/monitoring.html#pymongo.monitoring.register

Co-authored-by: Alex Boten <aboten@lightstep.com>
2020-04-27 13:11:07 -07:00
Mauricio Vásquez b6fddf991b ext/requests: Add instrumentor (#597)
Implement the BaseInstrumentor interface to make this library compatible with the opentelemetry-auto-instr command.

There is an issue about getting the span when the global tracer provider hasn't been configured, this should be changed in the future once we extend the opentelemetry-auto-instr command to also configure the SDK.
2020-04-27 11:16:49 -07:00
alrex 1c6b9c0431 redis: Porting redis instrumentation from contrib repo (#595)
Porting the existing redis instrumentation from the contrib repo to using the OpenTelemetry API and the OpenTelemetry Auto-instrumentation Instrumentor interface.

Similiar to the sqlalchemy PR, the main thing that will need updating is to remove the patch/unpatch methods once the instrumentor interface changes have been merged.

This is replacing open-telemetry/opentelemetry-python-contrib#21

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-04-27 09:48:39 -07:00
Diego Hurtado 2f6cac7d1a test: Add missing dependency (#614)
Fixes #613

some packages depend on the newest dev version of dbapi, which isn't published yet
when a package in a virtualenv is installed, it will attempt to install those dependencies, which searches on pypi

Installing the local package ensures that 0.7 is installed, so pip sees that and skips trying to resolve against pypi (when it won't find the version).
2020-04-27 08:29:34 -07:00
Leighton Chen c7b98ead83 PyMySQL Integration (#504)
Integration for PyMySQL.

Fixes some documentation as well for other db integrations. Leverages dbapi.

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
2020-04-24 13:18:02 -07:00
Mauricio Vásquez 437ff9af0d ext: Use TestBase (#586)
Update tests to use TestBase as described on #303.

Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-04-20 13:58:49 -07:00
alrex e3827bb0f2 updating psycopg2 dependency (#588)
Without using binary here, users will need the tools to compile psycopg2 on
their systems.
2020-04-16 13:35:25 -07:00
Mauricio Vásquez 224301b1a5 requests: Improvements for requests integration (#573)
Adding a TestBase class which wraps a tracer provider that is configured with a memory span
exporter.  This class inherits from unitest.TestCase, hence other test classes
can inherit from it to get access to the underlying memory span exporter and
tracer provider.

Adding a mock propagator that could be used for testing propagation in different packages.
It was implemented in the opentracing-shim and this commit moves it to a generic
place.

Adding disable_session(), which can be used to disable the instrumentation on a single
requests' session object.
2020-04-14 20:20:54 -07:00
Chris Kleinknecht 8f4c470159 Move shared test code from ext/ to tests/ (#559)
opentelemetry-ext-testutil is a package with shared test classes used by ext packages (right now only opentelemetry-ext-flask). We don't release this package, just import it in other tests.

Right now, on each release, we build everything in ext/. This means whoever does the release has to remember to exclude this package when they push the others to PyPI.

This moves the files and package:

Move files ext/opentelemetry-ext-testutil -> tests/util
Move package opentelemetry.ext.testutil -> opentelemetry.test
This makes maintainers' lives easier, but it does mean that other packages that use testutils will have to install install the opentelemetry.test package from source. But this is already the case since we don't publish opentelemetry-ext-testutil.

we move shared test code back into the main repo until we move a package that depends on it into a separate repo, at which point we'll have to put this code in its own top-level package.
2020-04-14 18:19:02 -07:00
Alex Boten 2ba7927ec1 updating readme, adding contributing doc 2020-04-14 14:37:56 -07:00
Hector Hernandez a800300cf8 test: Adding functional tests for MySQL integration (#526)
E2E verification for span creation using mysql and dbapi integrations
2020-04-13 09:01:01 -07:00
Hector Hernandez 9de5be3f82 Adding functional tests for psycopg2 integration (#528)
End to end verification for span creation using psycopg2 and dbapi integrations
2020-04-09 16:21:20 -07:00
alrex eaeb508242
ignore _template (#31) 2020-04-09 13:16:14 -07:00
alrex 1bc2440747
adding instructions to port instrumentation (#26)
Adding some instructions on how to port from the reference directory. More updates will be needed as tests are added. 

Co-Authored-By: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
2020-04-09 11:16:33 -07:00
Mauricio Vásquez fc4620c5b8
Add eachdist and move tox to root folder (#29)
Move tox and other configuration files to root folder. Add eachdist to make it
easier to handle operations with different packages.

The eachdist is taken from opentelemetry but slighty modified to avoid ignoring
a given path.
2020-04-09 10:06:59 -07:00
Chris Kleinknecht 0d4c5ffeb8 Require latest version of other packages in repo (#561)
Change unversioned requirements for packages in the same repo to ==0.7.dev0.

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
2020-04-08 13:49:32 -07:00
Mauricio Vásquez 0cf7ce2874
Small cleanup (#27)
- Remove .circle configuration
- Update CODEOWNERS and ISSUE_TEMPLATE in .github
- Restore LICENSE files
2020-04-08 13:17:31 -07:00
alrex 9df6cd15ad
Adding travis config (#25)
* adding travis config
2020-04-08 10:59:50 -07:00
Diego Hurtado 5aee3ce32e
Move DD code into its own directory (#6) 2020-04-08 10:39:44 -07:00
Diego Hurtado 7eacd3eab1 Fix Flask ext dependencies (#546)
Some Flask ext dependencies are missing or misplaced in the configuration file.

Fixes #545
2020-04-07 08:51:41 -07:00
Diego Hurtado 72b40ba5f9
Add common files (#19) 2020-04-06 14:51:43 -07:00
Chris Kleinknecht 5c728bedab gRPC integration (#476)
This is a port of grpcio-opentracing, and borrows from opencensus-ext-grpc. It
adds client and server interceptors that wrap each request in a span and use
the new context API to inject/extract the traceparent header to/from gRPC
metadata.

Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: Mario Jonke <mario.jonke@dynatrace.com>
Co-authored-by: Daniel González <danielgonzalezlopes@gmail.com>
Co-authored-by: Alex Boten <aboten@lightstep.com>
Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-03-30 18:04:24 -07:00
Chris Kleinknecht b6bb17503c Misc isort fixes (#535) 2020-03-30 16:00:19 -07:00
Diego Hurtado d446cb5e22 Add an autoinstrumentation mechanism and an instrumentor for Flask (#327)
Adding an autoinstrumentation mechanism and a Flask instrumentor (an instrumentor is a class that implements the _instrument and _uninstrument methods).

It works like this:

A console command is defined. This makes it possible to run a command named opentelemetry-auto-instrumentation that will execute this function.

When the opentelemetry-auto-instrumentation command is executed, then the instrument method of the different instrumentors is called, which are made available via an entry-point.

2.In the case of the Flask instrumentor, the original flask.Flask gets replaced with _InstrumentedFlask (in this case, the Flask instrumentor uses monkey patching to perform the instrumentation, nevertheless, monkey patching is not always the method used to do this, so the name instrumentor is preferred over patcher).

Once all instrumentation is enabled, the app is executed.

Co-Authored-By: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-03-30 12:44:43 -07:00
Daniel 9278d5ebf9 lint: Add test for package readme syntax errors (#492)
Add a test to ensure readmes render properly

Also adds README.rst for testutil package to pass new test.

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2020-03-27 21:45:15 -07:00
Daniel c108d15326 lint: Add test for package readme syntax errors (#492)
Add a test to ensure readmes render properly

Also adds README.rst for testutil package to pass new test.

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2020-03-27 21:45:15 -07:00
Sergey Kanzhelev 0eb2cac7b8
Remove NOTICE file (#5)
Remove notice file - keep copyright in individual file headers

See discussion here: open-telemetry/community#305
2020-03-26 08:42:01 -07:00
Mauricio Vásquez c92e7e0444 docs: Reorganize examples and improve ext packages documentation (#483)
This commit moves the text on the readmes of the external packages to their
source code as a docstring. This improves the generated documentation and helps
to consolidate the documentation in a single place.

Also unify the readmes present on each package to include a 1 line description, installation instructions and a link to the online documentation. This small readme will be the one shown on Github and on PyPI.

Also change the examples structure to have the following examples:
- basic meter & tracer
- http integration
- jaeger, prometheus, otcollector{tracer, metrics}
- opentracing shim

Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2020-03-24 14:45:54 -07:00
alrex ed6dd7f257
Removing support for python 2.7 (#2)
OpenTelemetry doesn't support Python 2.7. Removing it from the tests and removing contrib packages that don't support Python 3. In this change:

- removing pylons contrib
- removing mysqldb contrib
- updating minimum versions of flask (>=1.0), gevent (>=1.1)

Signed-off-by: Alex Boten <aboten@lightstep.com>
2020-03-23 09:43:03 -07:00
Mauricio Vásquez 6a56ce4132 Improve docs structure (#467)
- Creates a tree structure for documentation, it allows to organize it better
  from a developer point of view and also the rendered documentation should be
  easier to navigate.
- Moves partially the main readme to be included in the online docs, the main
  readme will be updated to have a link to avoid duplicated content)
- Moves the examples folder to the docs, so they can be accessed through the
  online documentation. Creates a new pair of "macros" to create links to
  specific versions, scm_web & scm_raw_web.

Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-03-10 09:50:16 -07:00
Mauricio Vásquez ef0536d34d Improve docs structure (#467)
- Creates a tree structure for documentation, it allows to organize it better
  from a developer point of view and also the rendered documentation should be
  easier to navigate.
- Moves partially the main readme to be included in the online docs, the main
  readme will be updated to have a link to avoid duplicated content)
- Moves the examples folder to the docs, so they can be accessed through the
  online documentation. Creates a new pair of "macros" to create links to
  specific versions, scm_web & scm_raw_web.

Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-03-10 09:50:16 -07:00
Mauricio Vásquez 56fda78b27 sdk: Implement observer instrument (#425)
Observer instruments are used to capture a current set of values at a point in
time [1].

This commit extends the Meter interface to allow to register an observer
instrument by pasing a callback that will be executed at collection time.
The logic inside collection is updated to consider these instruments and
a new ObserverAggregator is implemented.

[1] https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-metrics.md#observer-instruments
2020-03-02 14:02:03 -08:00
Chris Kleinknecht 79a2ca277c Prepare to host on readthedocs.org (#452) 2020-03-02 11:42:24 -08:00
Hector Hernandez 21cbbb6990 OT Collector trace exporter (#405)
Based on the OpenCensus agent exporter.

Fixes #343

Co-authored-by: Chris Kleinknecht <libc@google.com>
2020-02-27 16:37:24 -08:00
Brett Langdon f13c716af6
Merge in latest from datadog/dd-trace-py (#1) 2020-02-26 08:57:16 -08:00
Hector Hernandez 2256f07e53 Prometheus metric exporter (#378)
prometheus-exporter: initial commit
2020-02-21 11:31:04 -08:00
joshuahlang b259e320a6 Clean up tox.ini (#417)
Remove redundant environments and separate environments into logical groupings
for maintainability.
2020-02-20 09:25:04 -08:00
Yusuke Tsutsumi 260ca25911 Upgrading tox envs to python3.8 (#426)
Python3.8 is now stable, and we should run the common tasks under 3.8
instead of 3.7
2020-02-18 10:33:30 -08:00
alrex 2b2a512724 Adding Context API (#395)
This change implements the Context API portion of OTEP #66. The
CorrelationContext API and Propagation API changes will come in future PRs.
We're leveraging entrypoints to support other implementations of the Context
API if/when necessary. For backwards compatibility, this change uses
aiocontextvars for Python versions older than 3.7.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
2020-02-13 15:18:39 -08:00
Leighton Chen 5b282c3951 Metrics export pipeline + metrics stdout exporter (#341)
Initial implementation of the end-to-end metrics pipeline.
2020-02-11 11:07:11 -08:00
Hector Hernandez 35001a0c69 Add pymongo functional tests (#340) 2020-02-07 13:55:09 -08:00