* 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
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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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>
* 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>
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.
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.