Commit Graph

123 Commits

Author SHA1 Message Date
alrex 7d80d468e2 chore: update bootstrap with new instrumentations (#913) 2020-07-15 10:18:33 -07:00
Yusuke Tsutsumi 757f88f0af fastapi instrumentation (#890)
Co-authored-by: Leighton Chen <lechen@microsoft.com>
2020-07-14 23:49:12 -07:00
alrex 5c59ea0831 chore: migrate to circleci (#828) 2020-07-13 16:03:34 -07:00
Aaron Abbott 4438ae703c Script to regenerate proto code + pyi stubs (#823) 2020-06-22 10:47:07 -07:00
HiveTraum 6cc1e5a6a2 Instrumentation for asyncpg (#814)
Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-06-17 15:27:13 -07:00
Tahir H. Butt 83d8accf66 Add instrumentation for Celery (#780)
Ported from the DataDog instrumentation.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: alrex <alrex.boten@gmail.com>
2020-06-16 22:13:23 -07:00
Owais Lone 4e1cb880c1 Initial elasticsearch instrumentation (#747)
This commit adds auto-instrumentation for elasticsearch. The
instrumentation has been mostly ported over from OpenTracing
elasticsearch instrumentation.

Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
Co-authored-by: alrex <aboten@lightstep.com>
2020-06-16 22:09:43 -07:00
Tahir H. Butt bf5006e1e2 fix(tests): install asgi early (#831)
The lint job raising an error at installation:

ERROR: Could not find a version that satisfies the requirement opentelemetry-ext-asgi==0.10.dev0 (from opentelemetry-instrumentation-starlette==0.10.dev0) (from versions: 0.8b0, 0.9b0)
ERROR: No matching distribution found for opentelemetry-ext-asgi==0.10.dev0 (from opentelemetry-instrumentation-starlette==0.10.dev0)

The opentelemetry-ext-asgi should be installed before depending modules.
2020-06-16 10:37:10 -07:00
Yusuke Tsutsumi 244e709bf0 starlette instrumentation (#777)
adding an initial starlette instrumentation.

tox does exact match on fields delimited by a dash. Thus,
any instrumentation that includes "instrumentation" in the name
would collide with testing of the "opentelemetry-instrumentation"
package.

Renaming opentelemetry-instrumentation to opentelemetry-instrumentation-base to fix that.

Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: alrex <aboten@lightstep.com>
2020-06-15 13:59:57 -07:00
Eric Mustin 14289122c2 pymemcache: Add pymemcache instrumentation (#772)
initial implementation
2020-06-12 07:45:28 -07:00
Andrew Xue 9d3118ee7d chore: add test coverage for Cloud Monitoring exporter (#804)
Previously cloud monitoring was missing coverage.
2020-06-11 14:41:22 -07:00
Andrew Xue a74c16af9a chore: add opentelemetry-test as a dependancy (#809)
opentelemetry-test was not listed as a test dependency in the asgi instrumentation.
2020-06-10 20:15:47 -07:00
Diego Hurtado 9486b2d4d3 ext/otlp: Add OTLP span exporter (#787)
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: alrex <aboten@lightstep.com>
2020-06-10 16:44:29 -07:00
Connor Adams 64c2ff46be Instrumentation for Pyramid (#776)
Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-06-10 14:00:40 -07:00
Diego Hurtado 3e42946803 botocore: Add botocore instrumentation (#689)
Adding initial boto core implementation.

Co-authored-by: alrex <alrex.boten@gmail.com>
2020-06-09 14:18:03 -07:00
Diego Hurtado 9fa14e285e proto: Add proto files (#728)
Initial addition of opentelemetry-proto based protobufs.

Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-06-09 10:05:21 -07:00
Connor Adams 8d39609e47 refactor: Add common utils to opentelemetry-auto-instrumentation, rename opentelemetry-auto-instrumentation (#741) 2020-06-08 15:52:38 -07:00
Andrew Xue 3ef7afd255 cloud-trace: Cloud Trace exporter (#698)
Co-authored-by: Cheng-Lung Sung <clsung@gmail.com>
2020-06-03 21:33:36 -07:00
Yusuke Tsutsumi 82116bcfe9 opentracing-shim: add testbed for otshim (#727)
This commit ports the OpenTracing testbed[1] to check that the ot-shim is
working as expected using different frameworks.

Gevent doesn't support context vars yet[2], so those tests are not compatible
with opentelemetry and were not ported.

[1] https://github.com/opentracing/opentracing-python/tree/master/testbed
[2] https://github.com/gevent/gevent/issues/1407

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
Co-authored-by: alrex <aboten@lightstep.com>
2020-06-02 20:37:36 -07:00
Diego Hurtado 0a37a10713 ext/boto: Add boto instrumentation (#665) 2020-06-02 15:37:56 -07:00
alrex d79be1814f ext/system-metrics: adding instrumentation to collect system metrics (#652)
Adding an extension to provide users an easy mechanism to collect metrics for their system.
2020-05-29 14:02:37 -07:00
Tahir H. Butt 6c4541d4a7 asgi: Add ASGI middleware (#716)
Adding an ASGI extension.

Co-authored-by: Emil Madsen <sovende@gmail.com>
Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-05-27 09:17:35 -07:00
HiveTraum 626cf89620 ext/django: django downgrade to 1.10 (#717)
Adding support for django 1.10+
2020-05-25 08:29:51 -07:00
Diego Hurtado 76e1362485 opencensus: Rename otcollector to opencensus (#695)
renaming otcollector to opencensus, as it's using opencensus under the hood. This was originally intended to be replaced by otlp, by a new package can be created for that instead. 

Co-authored-by: alrex <alrex.boten@gmail.com>
2020-05-22 21:01:05 -07:00
Connor Adams 62f9e464b8 SQLite3 Instrumentation (#719)
Adds instrumentation for python sqlite3 library.
2020-05-21 16:14:25 -07:00
alrex 4f4e278162 infra: accelerate builds (#693)
Some build time improvements:

- split lint/docker-tests/docs into their own steps. Since lint is usually the thing that fails anyways, it's good to have it run first. We could make the build depend on this step to prevent slowing other builds waiting in the pipeline (since we only have 5 workers)
- move all pip install commands into a single line per test environment. this reduces the overhead of calling the pip command separately multiple times per environment.
- removed pip upgrade command for pypy3 and py38
2020-05-21 13:15:12 -07:00
Mauricio Vásquez a8dc31188b docs: Consolidate getting started guide and remove duplicated examples (#658)
There are some examples that are duplicated in the getting started guide and in
the examples folder itself. This commit removes the duplicated examples and
updates the getting started guide to include then from real source files that
are passed through the linter and have tests.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: alrex <aboten@lightstep.com>
2020-05-21 12:11:59 -07:00
Connor Adams fd24b54e28 ext/psycopg2: Implement BaseInstrumentor interface (#694)
- Implemented BaseInstrumentor interface to enable auto-instrumentation
- Added integration tests (same tests as other db integrations)
2020-05-20 21:50:17 -07:00
Mauricio Vásquez 37c4016e4e docs: Fix warning and treat them as errors (#666)
The CI is not able to catch many documentation problems because we are ignoring
warnings. This commit fixes most of the warnings, ignores the rest and enables
a flag to treat them as errors.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2020-05-14 20:27:16 -07:00
Tahir H. Butt 1767f5882c Add exporter to Datadog (#572)
Add an exporter to Datadog. This implementation makes use of ddtrace to handle the creation of Datadog traces and writing them to the Datadog agent.

Co-Authored-By: Mauricio Vásquez <mauricio@kinvolk.io>
2020-05-13 14:51:28 -07:00
Tahir H. Butt abb1fcfc05 jinja2: Add jinja2 instrumentation (#643)
Migrating the jinja2 plugin forked from ddtracepy.

Co-authored-by: Mauricio Vásquez <mauricio@kinvolk.io>
2020-05-11 09:33:06 -07:00
Mauricio Vásquez b0d1e0d4b1 ext/{dbapi,pymysql}: Implement methods to (un)-instrument connections (#624)
Implement to helper methods to allow users to enable / disable instrumentation
in a single connection object.

The current integrations based on dbapi allow to patch the connect function on those libraries to return an instrumented connection, however it's not possible to enable instrumentation on a connection previously created or to disable instrumentation in an instrumented connection.

This only implements the logic in PyMySQL, it can be easily done in other instrumentations once we think it's worth to be done.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Yusuke Tsutsumi <yusuke@tsutsumi.io>
2020-05-08 22:32:29 -07:00
Mauricio Vásquez 5d79a27fe6 ext/mysql: Add instrumentor interface (#655)
Implement to helper methods to allow users to enable / disable instrumentation
in a single connection object.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: alrex <alrex.boten@gmail.com>
2020-05-08 19:04:36 -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 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
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