27 Commits

Author SHA1 Message Date
0db4d0bb8f Replaced SpanAttributes with opentelemetry.semconv._incubating.attributes.db_attributes in tests. (#3532) 2025-05-22 16:07:21 +02:00
5c5fc732fb Replace assertEqualSpanInstrumentationInfo with assertEqualSpanInstrumentationScope (#3037)
* Replace assertInstInfo with assertInstScope

* Update Changelog

* Fix order of other changelog entries
2024-11-22 09:32:04 +01:00
eb8e45695e elasticsearch: don't produce spans if native elasticsearch support is enabled (#2524) 2024-05-24 13:13:37 -07:00
6a40ffd905 elasticsearch: tests against elasticsearch 8 (#2420)
* elasticsearch: bump handled version to 6.0

After 4de0e5659d451baee65af412242b95f174444d87

* elasticsearch: tests against elasticsearch 8
2024-05-14 14:59:41 -05:00
3291f38e8d elasticsearch: test against elasticsearch 7 (#2431)
* Update core repo SHA

* elasticsearch: test against elasticsearch 7

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-04-28 09:20:17 -05:00
4de0e5659d elasticsearch: stop testing on ancient versions (#2422)
Pick 6.0 as the baseline.
2024-04-18 08:57:26 -05:00
ca082a7c52 elasticsearch: don't set body as db statement for bulk requests (#2355)
* elasticsearch: don't set body as db statement for bulk requests

bulk requests can be too big and diverse to make sense as db statement.
Other than that the sanitizer currently only handles dicts so it's
crashing.

Closes #2150

Co-authored-by: Jason Mobarak <git@jason.mobarak.name>
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* Update CHANGELOG

* Please the linter

---------

Co-authored-by: Jason Mobarak <git@jason.mobarak.name>
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
2024-03-22 16:56:29 -06:00
5888d4ef95 Enable lint on CI and update deps (#2067)
* Fix black an isort

* change bootstrap_gen to use a list instead of dict

* Bunch of updates

* Fix build

* fix lint

* Fix docs

* Fix lint

* More fixes

* Fix lint

* fix stupid mistake

---------

Co-authored-by: Christian Hartung <christian.hartung@olist.com>
2023-11-21 10:25:11 +02:00
e70437a36e Add conditional elastic_transport import (#1810)
* Add conditional elastic_transport import

* Update changelog

* Add future es8 tests

* Update CHANGELOG.md

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

* Add license, rm pylint disable

* Consistent elastic version check

* lint import

* Update CHANGELOG.md

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
2023-06-25 08:25:09 +03:00
c9004bd375 Fix elastic-search sanitization for bulk queries (#1870)
* support sanitization for str body response

* add CHANGELOG entry

---------

Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
2023-06-25 07:44:57 +03:00
19fe7713e2 Sanitize DB_STATEMENT by default for elasticsearch (#1758) 2023-04-23 22:55:05 +05:30
aa6397ad59 Audit and test opentelemetry-instrumentation-elasticsearch NoOpTracer… (#1616)
* Audit and test opentelemetry-instrumentation-elasticsearch NoOpTracerProvider

* wip

* wip

* wip

* wip

* wip

---------

Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-18 02:07:07 +00:00
df32e8ca7f add elasticsearch db.statement sanitization (#1598) 2023-02-10 06:20:42 +05:30
78874df5c2 Fix install of Python 3.10 on GitHub Actions (#1609)
* Fix install of Python 3.10 on GitHub Actions

In PR #1604 the Python version was upgraded to Python 3.10 to fix a
local issue on M1 MacBooks.

The GitHub Action workflows now exit with the following message for the
docker-tests, spellcheck and lint checks, skipping these checks.

```
lint create: /home/runner/work/opentelemetry-python-contrib/opentelemetry-python-contrib/.tox/lint
SKIPPED: InterpreterNotFound: python3.10
___________________________________ summary ____________________________________
SKIPPED:  lint: InterpreterNotFound: python3.10
  congratulations :)
```

Upgrade the Python version in the GitHub Actions workflow to fix this.

* Fix YAML interpretation of Python 3.10

* Upgrade Docker tests dependencies

Upgrade the asyncpg and psycopg2 packages, they don't work on Python
3.10.

This also fixes running these tests no M1 MacBooks.

* Fix linter issues merged into main

They went unnoticed while the CI didn't fail on the lint task not
working.

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-03 08:37:24 +05:30
db478789e4 bugfix: correct generate search span_name (#1018) 2022-03-24 10:56:52 -07:00
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
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
291e50813a adding response_hook to elastic instrumentation (#670) 2021-09-14 11:09:14 -07: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
ffc2a2ff4c More consistent assertion methods (#641)
* More consistent assertion methods

* Updated core SHA
2021-08-30 22:46:18 +02:00
8d0c150b31 Sync with auto generated semantic convention constants (#428) 2021-04-19 23:37:10 -07:00
9315eb0fb2 use StatusCode from trace instead of trace.status (#366) 2021-03-09 14:33:13 -08:00
f436514554 Replaced Tracer.use_span() with opentelemetry.trace.use_span() (#364) 2021-03-08 09:33:49 -08:00
f0adb23143 Remove 'component' span attribute in instrumentations (#301) 2021-01-29 13:15:26 -08:00
f5c3825e33 Change status codes from grpc status codes, remove setting status in instrumentations except on ERROR (#1282) 2020-10-28 14:28:58 -07:00
44fbb714b1 Use is_recording flag in jinja, celery, esearch, falcon instrumentations (#1241) 2020-10-14 12:07:23 -07:00
a49c812e6d Rename remaining framework packages from "ext" to "instrumentation" (#969) 2020-08-04 19:10:51 -07:00