* Add instrumentation for AWS Lambda Service - Implementation
* Lambda is CONSUMER SQS trace if 'Records' key in Lambda event
* More robust check of SQS by indexing and catching
* Explicitly catch errors we expect when determinig if SQS triggered Lambda
The `setuptools` package is not part of the stdlib, but often available
in the system environment (it is a buildtime requirement).
`pkg_resources` (a package provided by `setuptools`) is used as
a runtime requirement in `opentelemetry-instrumentation`. Explicitly
listing `setuptools` as a requirement protects instrumentation from
breaking with import errors in cases where `setuptools` is not available
system-wide.
For example:
* A multi-stage Docker build where the final image does not contain
buildtime requirements.
* A build system that packages the runtime dependencies into a single
binary.
This commit pins `setuptools >= 16.0` because that is the first release
that included all 5 imports instrumentation currently relies on.
Co-authored-by: Matt Oberle <mattoberle@users.noreply.github.com>
* Refactor code using pyupgrade for Python 3.6
This diff is the result of applying the following command to the
project:
```shell
find . -type f -name "*.py" -exec pyupgrade --py36-plus '{}' +
```
* Simplify yield from
opentelemetry-instrumentaiton-asgi does not contain an instrumentor for
asgiref. Instead, it implements an ASGI middleware that other
instrumentors import and use. As such, other instrumentors can take a
dependency on this package without asgiref being installed locally. This
commit adds `asgiref` as a dependency to the
opentelemetry-instrumentation-asgi package so the middleware can
function properly when used by another instrumentation.
* 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>
* 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>
* 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>
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.
* 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
* 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
* 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>
* 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>
* 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.
* 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