Commit Graph

1342 Commits

Author SHA1 Message Date
Mario Jonke 3058281f5e
botocore: Add DynamoDB extension (#735)
* botocore: Add dynamodb extension

* extract addtional DynamoDB specific attributes according to the spec
* move DynamoDB tests to separate test module

* changelog

* add license info

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-10-18 11:53:06 +02:00
Nikolay Sokolik bf41b2e33f
Bugfix/set default headers for properties in pika (#740)
* Bugfix the porperties.headers in the pika instrumentation, and write tests that ensure it

* Ensure that BasicProperties is called with headers={}

* Update CHANGELOG.md

* Update the span kind from SERVER/CLIENT to PRODUCER/CONSUMER

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-10-17 17:38:00 +05:30
Owais Lone 4e3aaa51ec
Fixed changelog (#746) 2021-10-15 19:02:33 +00:00
Owais Lone 8ad84a56d0
Remove HTTPClientInstrumentor instrumentation entry point (#745)
Fixes #744

This is a temporary hotfix for the issue linked above. We'll need to
figure out a proper fix later.
2021-10-16 00:12:52 +05:30
(Eliseo) Nathaniel Ruiz Nowell f7256f5236
Fix build script to not release stable pkgs (#743) 2021-10-15 13:54:56 +02:00
Andrew Matteson b5d3074e8f
Implement checking for suppression key in pymongo instrumentation (#736)
* Implement checking for suppression key


Add test for suppression key with pymongo


changelog update

* Linting

* pylint

* Bad reformat

* Update changelog with PR

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-10-15 00:27:30 +00:00
alrex face2a3272
refactor common test code to use utility method (#700) 2021-10-14 22:19:02 +00:00
alrex 3ebfdb1a54
adding missing python 3.9 classifier (#741) 2021-10-14 21:52:44 +00:00
Owais Lone 7cf3cb42cf
Add instrumentation and distro packages (#738)
Now that SDK does not depend on opentelemetry-instrumentation
anymore and opentelemetry-instrumentation has actual build time
dependencies on the contrib repo, it makes maintanence a lot
easier if we move opentelemetry-instrumentation to contrib repo.
opentelemetry-distro depends on opentelemetry-instrumentation
and is being moved as well. Neither of the two packages are
really part of "core" Otel python anyway.
2021-10-14 20:35:28 +00:00
Ben Campbell 3f3de86df5
Fix RuntimeError: Working outside of request context. (#734) 2021-10-14 18:07:49 +00:00
Leighton Chen 9f6c97af9f
Release/1.6.0 0.25b0 (#732) 2021-10-13 14:54:52 -07:00
(Eliseo) Nathaniel Ruiz Nowell cf718aab1f
Path of AWS Propagator tests match src structure (#733) 2021-10-13 05:53:20 +05:30
Remi Rampin 1b75672e73
Don't create Elasticsearch span names containing document IDs (#705)
* Fix typo: _DEFALT_OP_NAME

* Extract ES document ID from URL, put in attributes

Elasticsearch creates URLs for index() and delete() before they hit
perform_request(). This means there would be many unique span names
containing unique document IDs, of the form
'Elasticsearch/indexname/_doc/documentid'.

This extracts the document ID from the URL and replaces it with ':id',
then puts it in the span's attributes.

* Add TODO comment with link to issue

* Add CHANGELOG entry

* Don't use custom doc types, deprecated in ES 7

* Update tests to match instrumentation
2021-10-13 04:00:00 +05:30
(Eliseo) Nathaniel Ruiz Nowell 4046fdb0a2
Rename AWS X-Ray propagator test file for to change (#731) 2021-10-13 01:57:07 +05:30
(Eliseo) Nathaniel Ruiz Nowell 78f887ef3d
Better file naming for AWS XRay Propagator + Add NathanielRN as Propagator owner (#729) 2021-10-12 19:08:16 +00:00
Jim Myers e8af7a3339
Respect provided tracer provider when instrumenting SQLAlchemy (#728)
* respect provided tracer provider when instrumenting sqlalchemy

This change updates the SQLALchemyInstrumentor to respect the tracer
provider that is passed in through the kwargs when patching the
`create_engine` functionality provided by SQLAlchemy. Previously, it
would default to the global tracer provider.

* feedback: pass in tracer_provider directly rather than kwargs

* feedback: update changelog

* build: lint
2021-10-12 17:49:22 +00:00
Michael Manganiello 5105820fff
Add Django ASGI support (#391) 2021-10-12 10:28:03 -07:00
andrew-matteson 36275f3cbf
Expand allowed versions for jinja2 instrumentation (#712)
* Expand allowed versions

The Jinja2 API hasn't changed the functions that have been wrapped in at least 8 years.
The version supported should be much more broad.

* don't include 4+

* Update changelog

* Fix test that depends on lru_cache now

* tox -e generate

* Make test setup backwards compatible

* Update for code review feedback

* Disable linting check

* Fix black formatting issue

* Update readme from tox -e generate

* Update core repo sha

Co-authored-by: alrex <aboten@lightstep.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Owais Lone <owais@users.noreply.github.com>
2021-10-12 16:15:16 +00:00
(Eliseo) Nathaniel Ruiz Nowell 224780f38d
Move AWS X-Ray Propagator into its own package (#720)
Co-authored-by: Owais Lone <owais@users.noreply.github.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-10-12 15:44:03 +00:00
Mario Jonke c3df816ad8
botocore: Introduce instrumentation extensions (#718)
* botocore: Introduce instrumentation extensions

* add extensions that are invoked before and after an AWS SDK
  service call to enrich the span with service specific request and
  response attirbutes
* move SQS specific parts to a separate extension

* changelog

Co-authored-by: Owais Lone <owais@users.noreply.github.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2021-10-12 15:29:35 +00:00
Owais Lone b41a91713e
Fix mssql docker tests v4 (#727)
* Remove unneded CI steps

These were not really needed and got in by mistake.

* Fix broken mssql integration tests

We were giving mssql server 10 seconds to start before creating the test
database. It now takes Github CI more than 10 seconds to start the mssql
server. Instead of increasing the leeway with guesses, this commit moves
the creation of test database from docker compose to the python test suite.
This allows the docker image to come up first and then create the DB
inside the test suite with proper retry mechanism that is already in
place.
2021-10-12 17:19:13 +02:00
Owais Lone cc2e7d276b
Fix mssql docker tests v2 (#723)
* Pin ubuntu to 20.04 in CI

* Fix mssql docker tests
2021-10-12 01:43:32 +05:30
DJ Gregor 7f00fb88f2
Fix doc error in file-level code block (#710) 2021-10-11 09:51:52 -07:00
Owais Lone 19e748f000
Revert "Pin ubuntu version in CI to 20.04"
This reverts commit d8373236da.
2021-10-11 22:05:03 +05:30
Owais Lone d8373236da
Pin ubuntu version in CI to 20.04 2021-10-11 21:50:58 +05:30
Nikolay Sokolik 492830f24f
Bugfix/set default context in pika (#719)
* Add a default context when one does not exist

* Split the if to fit C0325: Unnecessary parens after 'not' keyword

* Split the context retrieving according to the function
2021-10-11 19:53:19 +05:30
Ben Campbell 5be20f9dc8
Adding `tracked_url_callback` to `RequestsInstrumentor` (#714)
* Adding `tracked_url_callback` to `RequestsInstrumentor`

* linting fixes and CHANGELOG update

* Switching to `get_excluded_urls`

* Update CHANGELOG.md

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

* Fixing linting

* Stop patch in tearDown

* Fixing lint

* Fixing lint

* Fixing lint

Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Owais Lone <owais@users.noreply.github.com>
2021-10-08 21:14:02 +00:00
Leighton Chen c01aaa16fa
Add oxeye-nikolay as codeowner for pika instrumentation (#717) 2021-10-06 13:20:11 -07:00
Matt Oberle 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
Nikolay Sokolik 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
Mario Jonke 196037125f
botocore: Make common span attributes compliant with semconv in spec (#674) 2021-10-06 09:47:50 -07:00
Remi Rampin 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
(Eliseo) Nathaniel Ruiz Nowell c143d0534f
Fix typo in AWS X-RAY Propagator (#702) 2021-10-01 05:08:26 +05:30
ItayGibel-heliosphere 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
Anthony Shaw 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
alrex 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
alrex 2710e25b78
add Python 3.9 to setup.cfg template (#698) 2021-09-28 17:26:18 +00:00
alrex d2984f5242
remove need to clone core repo (#678) 2021-09-27 20:28:32 +00:00
Adrian Garcia Badaracco 8e0d0e04a9
Falcon 3 support (#644) 2021-09-27 19:58:13 +00:00
Mario Jonke 2b0a634a71
Fix datadog exporter test (#697) 2021-09-27 17:48:29 +00:00
Christian Neumüller efaa257a63
Add net.peer.ip in requests & urllib3 instrumentations. (#661) 2021-09-27 10:21:26 -07:00
(Eliseo) Nathaniel Ruiz Nowell 201aa2bb1b
chore: Set SDK Ext AWS to 1.1.0dev0 (#696) 2021-09-22 14:21:29 -07:00
alrex eded5f7df6
use {} instead of dict() (#695) 2021-09-22 17:37:24 +00:00
alrex 354bdc42d9
update open calls to pass encoding (#684) 2021-09-22 10:16:14 -07:00
alrex 1cf5021bb6
remove unicode prefix, no longer necessary (#689) 2021-09-20 23:53:19 +00:00
(Eliseo) Nathaniel Ruiz Nowell 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
alrex a7680719f2
removing workflow to automatically close issues (#682) 2021-09-16 15:43:21 -07:00
ItayGibel-heliosphere db636a462c
adding response_hook to redis instrumentor (#669) 2021-09-14 13:47:12 -07:00
ItayGibel-heliosphere 291e50813a
adding response_hook to elastic instrumentation (#670) 2021-09-14 11:09:14 -07:00
ItayGibel-heliosphere 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