1314 Commits

Author SHA1 Message Date
2bcb6ae66b Fix missing 'packaging' requirement (#713)
The `sqlalchemy` instrumentation uses the `packaging` library to parse
the `sqlalchemy` SemVer.

`packaging` is not part of the standard library and should be included
in the `setup.cfg` file to avoid:

```
ModuleNotFoundError: No module named 'packaging'
```

Co-authored-by: Matt Oberle <mattoberle@users.noreply.github.com>
Co-authored-by: Owais Lone <owais@users.noreply.github.com>
2021-10-06 19:56:55 +00:00
fb24599324 Feature/add pika instrumentation (#680)
* Added initial code

* Add all needed spans, and add support of instrumentation and uninstrumentation

* Added tests. Ready for PR

* Rename RequestsInstrumentation to RequestsInstrumentor to follow conventions

* Add suppress_instrumentation functionality

* Fix suppress_instrumentation functionality

* Fix CR comments and lint test failures

* Add usage of wrapt according to CR comments

* Fix according to CR Comments

* Move the tracer to be an attribute of the instrumentor instead of the channel

* Fix Tests

* Update Changelog and fix failing test

* update code using tox -e generate

* Update the name of the variable to store the tracer provider.

* Update the core repo hash in the workflow

* Update the core repo hash in the workflow

Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Owais Lone <owais@users.noreply.github.com>
2021-10-06 23:52:39 +05:30
196037125f botocore: Make common span attributes compliant with semconv in spec (#674) 2021-10-06 09:47:50 -07:00
3b5071b5a3 Tornado attributes (#706)
* Remove duplicate HTTP_HOST

* Set http.client_ip instead of net.peer.ip

Tornado sets remote_ip to the value of X-Forwarded-For or X-Real-IP if
the 'xheaders' setting is set.

* Add a "handler" attribute, with full class name

The spec has a 'http.route' which unfortunately seems difficult to get
at. However the full class name is readily available and most helpful.

* Add net.peer.ip from _orig_remote_ip

* Address review comments

- Don't set NET_PEER_IP if '_orig_remote_ip' is not set
- Add a comment about the difference between the attributes

* Make "handler" attribute into "tornado.handler"

* Add CHANGELOG entry

* Add test with X-Forwarded-For

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2021-10-04 21:31:30 +05:30
c143d0534f Fix typo in AWS X-RAY Propagator (#702) 2021-10-01 05:08:26 +05:30
7bc8f6cf5e botocore hooks (#679)
* botocore hooks

* a single hook for all aws services

* fix test

* rename get_item_attributes variable to put_item_attributes

* rename tests

* delete redundant line
2021-09-30 15:03:37 +02:00
bba4b9e76f Add a rich console exporter (#686)
* Add a rich console exporter

* be more lenient on missing parent spans

* Apply suggestions from code review

Co-authored-by: Aaron Abbott <aaronabbott@google.com>

* run black over source

* patch change by hand

* update changelog

* remove defunct statement

* Clarify the simple/batch span processor

* fix f-strings that dont have formatting

* clarify span usage and update classifiers

* make child_to_tree a private function and rename some variables

Co-authored-by: Aaron Abbott <aaronabbott@google.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: alrex <aboten@lightstep.com>
2021-09-29 14:32:01 +00:00
fbb677a01d use f-strings instead of format (#693)
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-09-28 19:12:47 +00:00
2710e25b78 add Python 3.9 to setup.cfg template (#698) 2021-09-28 17:26:18 +00:00
d2984f5242 remove need to clone core repo (#678) 2021-09-27 20:28:32 +00:00
8e0d0e04a9 Falcon 3 support (#644) 2021-09-27 19:58:13 +00:00
2b0a634a71 Fix datadog exporter test (#697) 2021-09-27 17:48:29 +00:00
efaa257a63 Add net.peer.ip in requests & urllib3 instrumentations. (#661) 2021-09-27 10:21:26 -07:00
201aa2bb1b chore: Set SDK Ext AWS to 1.1.0dev0 (#696) 2021-09-22 14:21:29 -07:00
eded5f7df6 use {} instead of dict() (#695) 2021-09-22 17:37:24 +00:00
354bdc42d9 update open calls to pass encoding (#684) 2021-09-22 10:16:14 -07:00
1cf5021bb6 remove unicode prefix, no longer necessary (#689) 2021-09-20 23:53:19 +00:00
50e7b1b708 Patch update SDK Extension AWS to version 1.0.1 (#672)
Co-authored-by: Leighton Chen <lechen@microsoft.com>
2021-09-16 16:13:14 -07:00
a7680719f2 removing workflow to automatically close issues (#682) 2021-09-16 15:43:21 -07:00
db636a462c adding response_hook to redis instrumentor (#669) 2021-09-14 13:47:12 -07:00
291e50813a adding response_hook to elastic instrumentation (#670) 2021-09-14 11:09:14 -07:00
b47328e134 Urllib3 request hook (#660)
* Urllib3: extend request hook with request body and headers

* Change GET to POST in test_extended_request_hook

* added changelog entry

* update ExtendedReqeustHookT

* adding up to date generated code

* replace _RequestHookT with _ExtendedRequestHookT

* updated Changelog

Co-authored-by: Ran Nozik <ran@heliosphere.io>
2021-09-13 22:58:59 +05:30
fc8a02bcf8 Release AWS Python SDK Extension as 1.0 (#667) 2021-09-09 13:01:47 -07:00
915acb1b7c Remove unnecessary dependencies (#631) 2021-09-09 09:48:50 -07:00
3e9adfddb0 botocore: Fix span inject for lambda invoke (#663)
* Botocore: Fix span inject for lambda invoke

* for lambda invoke span injection happend to early which resulted in the botocore
  span being injected instead of the actual botocore span

* changelog

Co-authored-by: alrex <aboten@lightstep.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-09-09 16:35:48 +02:00
97e9f2f9ef Update Doc for aws propagator default sampling behavior (#656) 2021-09-08 11:43:20 -07:00
704f1d9cfd Do not fail tests if component owners workflow fails (#666) 2021-09-08 10:45:36 -07:00
a78c94ce59 README includes 1.0 release checklist + CODEOWNER description (#596)
* README 1.0 release checklist + what is a CODEOWNER

* Do not required SLA for responding to asks

* Easy changes to address reviewer comments

* Introduce on Slack at least not SIG meeting

* Give guidance when a CODEOWNER wants to leave a project

* Update README.md

Take suggestion package "MUST" wording.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>

* Update README.md

Take suggestion on CODEOWNER requirement wording.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>

* Apply suggestions from code review

Take more suggestions on checklist list requirements.

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>

* Update README.md

Take suggestion on MUST requirement for documentation.

* Add back missing bullet point

* Do not say perpetually 1.0 instead say up to maintainers

* Make it explicity CODEOWNER is for 1 file

* Make OTel Community membership a requirement because the action we use requires it

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-09-08 19:14:20 +02:00
fd5fc9a101 botocore: Fix uninstrument to also unpatch header injection on Endpoint (#664) 2021-09-08 09:33:41 -07:00
984f5cd2d3 Fix documentation for MySQL instrumentation (#665) 2021-09-07 14:47:38 -07:00
0e5853b0c6 Change action to address forks (#659) 2021-09-03 10:16:55 -07:00
0d34ef26b7 Add component owner action (#655) 2021-09-02 12:50:16 -07:00
65fb21ce3e Falcon: handle env vars locally vs globally (#650)
All instrumentations read most env vars today at module level. This has
a few disadvantages.

- harder to test.
- code executed on import even if instrumentation is not used.
- forces to use global vars.

This commit fixes the Falcon instrumentation to handle env vars locally
during instrumentor initialization and considerably simplifies testing.
Other instrumentations should receive similar treatment.
2021-09-02 17:16:09 +05:30
c4639ee3f5 Fix flaky celery docker test (#652)
The test was actually generating 2 spans but on very fast systems we
only saw one as the test ran faster than the message would travel
through the broker, trigger a task and generate 2nd span.

Switched from .delay() to .apply() so only one span is generated which
is enough for the test in question.
2021-09-02 10:14:38 +02:00
2e77bfc555 Added a script to generate readme file for root instrumentations (#647)
directory

This file lists down all instrumentations and the packages+versions they
support. This is helpful to find out at a glance what is exactly
supported.

Co-authored-by: alrex <aboten@lightstep.com>
2021-09-02 01:33:02 +05:30
b6e49ba66d Remove unused imports (#646)
* Remove unused imports

Fixes #645

* Fix lint

* Import trace_tween_factory

* Fix lint

* Fix lint

* Fix pylint

* Try without using the symbol

* Fix isort

* Revert "Fix isort"

This reverts commit 4dbd91450b4ee099fd09ab1ca0fb8ae9c10bdcfa.

* Revert "Try without using the symbol"

This reverts commit d94f95564671a3155edf44bf71bf58f22ca309f0.
2021-09-01 19:38:02 +02:00
cc57aacd71 Improve reliability of tests (#643)
* Run tests on Windows in Github Actions

* core sha update

* format code

* fix ci yaml

* rebase

* lint

* Try without win+py3.6 fix

* Try without win+py3.6 fix

* Improve test reliability

Update some tests to use more deterministic methods of testing in memory
spans. This helps the core repo pass tests after adding Windows to CI
matrix.
2021-09-01 12:06:13 +02:00
c279ee59a8 Rerun a flaky test (#639)
* Rerun a flaky test
2021-08-31 03:47:58 +05:30
ffc2a2ff4c More consistent assertion methods (#641)
* More consistent assertion methods

* Updated core SHA
2021-08-30 22:46:18 +02:00
d4668bcbc7 Release/1.5.0 0.24b0 (#628)
* updating changelogs and version to 1.4.0-0.24.dev0

* updating changelogs and version to 1.5.0-0.24b0

* Update CHANGELOG.md

Co-authored-by: Leighton Chen <lechen@microsoft.com>

* Update CHANGELOG.md

Co-authored-by: Leighton Chen <lechen@microsoft.com>

Co-authored-by: Leighton Chen <lechen@microsoft.com>
v0.24b0
2021-08-26 14:54:46 +05:30
c6976fc51f Potential fix for flaky celery test (#629)
It seems the same in memory span exporter was being reused by multiple
tests. This change _should_ create a new instance of memeory exporter
per test/function.

Fixes #2067
2021-08-26 03:30:26 +05:30
bfaabbf7e1 Make Falcon instrumentation compatible with Falcon >=3 (#607)
* Make Falcon  instrumentation compatible with Falcon >=3

Replace falcon.api.Request -> falcon.Request which exists on both Falcon 2 & 3

* Update package.py

* Update CHANGELOG.md

* update tox.ini

* revert changes to tox.ini to test failures

* Update package.py

Co-authored-by: Owais Lone <owais@users.noreply.github.com>
2021-08-25 04:09:06 +05:30
9c4eb69ab8 Allow instrumentation of newer FastAPI versions (#602)
* Allow instrumentation of newer FastAPI versions

Since the introduction of the `_instruments` runtime checks in #475, the
FastAPI instrumentation has stopped working for versions >= `0.59.0`.
However the current test suite passes even for the latest released
version at the moment (`0.67.0`).

It seems this isn't related to a limitation in the instrumentation code,
but actually because of it being created when `0.58` was the latest version:
7bec76a220.

* Add changelog entry

Co-authored-by: Owais Lone <owais@users.noreply.github.com>
2021-08-25 03:34:26 +05:30
cc2529e2cd Fix tox lint command (#623)
* Fix tox lint command

- Move apt-get install command to github actions to run on an ubuntu
  system only. This keeps tox.ini cross-platform and enabled to run on
  non-ubuntu systems locally.
- Add `-y` flag to apt-get install command so it does not wait for
  configuration on CI.

* Downgrade pylint to 2.9.x

* Add pip cache to github actions cache
2021-08-25 02:48:23 +05:30
d9c0116871 Worklow to publish a package from a CODEOWNER tag (#598)
* Worklow to publish a package from a CODEOWNER tag

* Prevent main script from release >=1.0 packages

* Fixes to build package workflow and script

* Better naming and remove redundant ls flag

* Add err msg for missing setup.py ls match

* Use lowercase for all non env variable vars
2021-08-19 22:11:35 +05:30
b8fe7fc7cd EKS Detector should return empty string, not resource if env var missing (#613)
* EKS Detector returns string if missing env var

* Update sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/eks.py

Add return value typing to _get_cluster_name method

Co-authored-by: Aaron Abbott <aaronabbott@google.com>

Co-authored-by: Aaron Abbott <aaronabbott@google.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-08-13 17:14:41 -04:00
f878b834f8 add comment to tox (#621) 2021-08-13 13:28:04 -07:00
05944cb645 docs: Update instrumentation example in readme (#615) 2021-08-13 12:35:30 -07:00
e90452ff56 Add note about Falcon version support (#611) 2021-08-13 11:35:21 -07:00
ebcdbdb660 Exit AWS ECS and EKS Detector container file reads early if container id found (#612) 2021-08-13 09:25:14 -07:00