mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 06:03:21 +08:00
elasticsearch: stop testing on ancient versions (#2422)
Pick 6.0 as the baseline.
This commit is contained in:

committed by
GitHub

parent
9ce1c26d27
commit
4de0e5659d
@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300))
|
||||
- Rename AwsLambdaInstrumentor span attributes `faas.id` to `cloud.resource_id`, `faas.execution` to `faas.invocation_id`
|
||||
([#2372](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2372))
|
||||
- Drop support for instrumenting elasticsearch client < 6`
|
||||
([#2422](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2422))
|
||||
|
||||
### Added
|
||||
|
||||
|
@ -28,7 +28,7 @@ boto3~=1.0
|
||||
cassandra-driver~=3.25
|
||||
celery>=4.0
|
||||
confluent-kafka>= 1.8.2,<= 2.3.0
|
||||
elasticsearch>=2.0,<9.0
|
||||
elasticsearch>=6.0,<9.0
|
||||
flask~=2.0
|
||||
falcon~=2.0
|
||||
grpcio~=1.27
|
||||
|
@ -32,7 +32,7 @@ dependencies = [
|
||||
|
||||
[project.optional-dependencies]
|
||||
instruments = [
|
||||
"elasticsearch >= 2.0",
|
||||
"elasticsearch >= 6.0",
|
||||
]
|
||||
|
||||
[project.entry-points.opentelemetry_instrumentor]
|
||||
|
@ -1,22 +0,0 @@
|
||||
asgiref==3.7.2
|
||||
attrs==23.2.0
|
||||
Deprecated==1.2.14
|
||||
elasticsearch==2.4.1
|
||||
elasticsearch-dsl==2.2.0
|
||||
importlib-metadata==6.11.0
|
||||
iniconfig==2.0.0
|
||||
packaging==23.2
|
||||
pluggy==1.4.0
|
||||
py==1.11.0
|
||||
py-cpuinfo==9.0.0
|
||||
pytest==7.1.3
|
||||
pytest-benchmark==4.0.0
|
||||
python-dateutil==2.8.2
|
||||
six==1.16.0
|
||||
tomli==2.0.1
|
||||
typing_extensions==4.10.0
|
||||
urllib3==1.26.18
|
||||
wrapt==1.16.0
|
||||
zipp==3.17.0
|
||||
-e opentelemetry-instrumentation
|
||||
-e instrumentation/opentelemetry-instrumentation-elasticsearch
|
@ -1,22 +0,0 @@
|
||||
asgiref==3.7.2
|
||||
attrs==23.2.0
|
||||
Deprecated==1.2.14
|
||||
elasticsearch==5.5.3
|
||||
elasticsearch-dsl==5.4.0
|
||||
importlib-metadata==6.11.0
|
||||
iniconfig==2.0.0
|
||||
packaging==23.2
|
||||
pluggy==1.4.0
|
||||
py==1.11.0
|
||||
py-cpuinfo==9.0.0
|
||||
pytest==7.1.3
|
||||
pytest-benchmark==4.0.0
|
||||
python-dateutil==2.8.2
|
||||
six==1.16.0
|
||||
tomli==2.0.1
|
||||
typing_extensions==4.10.0
|
||||
urllib3==2.2.1
|
||||
wrapt==1.16.0
|
||||
zipp==3.17.0
|
||||
-e opentelemetry-instrumentation
|
||||
-e instrumentation/opentelemetry-instrumentation-elasticsearch
|
@ -1,33 +0,0 @@
|
||||
from elasticsearch_dsl import ( # pylint: disable=no-name-in-module
|
||||
DocType,
|
||||
String,
|
||||
)
|
||||
|
||||
|
||||
class Article(DocType):
|
||||
title = String(analyzer="snowball", fields={"raw": String()})
|
||||
body = String(analyzer="snowball")
|
||||
|
||||
class Meta:
|
||||
index = "test-index"
|
||||
|
||||
|
||||
dsl_create_statement = {
|
||||
"mappings": {
|
||||
"article": {
|
||||
"properties": {
|
||||
"title": {
|
||||
"analyzer": "snowball",
|
||||
"fields": {"raw": {"type": "string"}},
|
||||
"type": "string",
|
||||
},
|
||||
"body": {"analyzer": "snowball", "type": "string"},
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {"analysis": {}},
|
||||
}
|
||||
dsl_index_result = (1, {}, '{"created": true}')
|
||||
dsl_index_span_name = "Elasticsearch/test-index/article/2"
|
||||
dsl_index_url = "/test-index/article/2"
|
||||
dsl_search_method = "GET"
|
@ -1,33 +0,0 @@
|
||||
from elasticsearch_dsl import ( # pylint: disable=no-name-in-module
|
||||
DocType,
|
||||
Keyword,
|
||||
Text,
|
||||
)
|
||||
|
||||
|
||||
class Article(DocType):
|
||||
title = Text(analyzer="snowball", fields={"raw": Keyword()})
|
||||
body = Text(analyzer="snowball")
|
||||
|
||||
class Meta:
|
||||
index = "test-index"
|
||||
|
||||
|
||||
dsl_create_statement = {
|
||||
"mappings": {
|
||||
"article": {
|
||||
"properties": {
|
||||
"title": {
|
||||
"analyzer": "snowball",
|
||||
"fields": {"raw": {"type": "keyword"}},
|
||||
"type": "text",
|
||||
},
|
||||
"body": {"analyzer": "snowball", "type": "text"},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
dsl_index_result = (1, {}, '{"created": true}')
|
||||
dsl_index_span_name = "Elasticsearch/test-index/article/2"
|
||||
dsl_index_url = "/test-index/article/2"
|
||||
dsl_search_method = "GET"
|
@ -44,10 +44,6 @@ elif major_version == 7:
|
||||
from . import helpers_es7 as helpers # pylint: disable=no-name-in-module
|
||||
elif major_version == 6:
|
||||
from . import helpers_es6 as helpers # pylint: disable=no-name-in-module
|
||||
elif major_version == 5:
|
||||
from . import helpers_es5 as helpers # pylint: disable=no-name-in-module
|
||||
else:
|
||||
from . import helpers_es2 as helpers # pylint: disable=no-name-in-module
|
||||
|
||||
Article = helpers.Article
|
||||
|
||||
|
@ -73,7 +73,7 @@ libraries = [
|
||||
"instrumentation": "opentelemetry-instrumentation-django==0.46b0.dev",
|
||||
},
|
||||
{
|
||||
"library": "elasticsearch >= 2.0",
|
||||
"library": "elasticsearch >= 6.0",
|
||||
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.46b0.dev",
|
||||
},
|
||||
{
|
||||
|
16
tox.ini
16
tox.ini
@ -78,13 +78,9 @@ envlist =
|
||||
; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620
|
||||
; The numbers at the end of the environment names
|
||||
; below mean these dependencies are being used:
|
||||
; 0: elasticsearch-dsl>=2.0,<3.0 elasticsearch>=2.0,<3.0
|
||||
; 1: elasticsearch-dsl>=5.0,<6.0 elasticsearch>=5.0,<6.0
|
||||
; 2: elasticsearch-dsl>=6.0,<7.0 elasticsearch>=6.0,<7.0
|
||||
py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,2}
|
||||
pypy3-test-instrumentation-elasticsearch-{0,2}
|
||||
py3{8,9}-test-instrumentation-elasticsearch-1
|
||||
pypy3-test-instrumentation-elasticsearch-1
|
||||
; 6: elasticsearch-dsl>=6.0,<7.0 elasticsearch>=6.0,<7.0
|
||||
py3{8,9,10,11}-test-instrumentation-elasticsearch-6
|
||||
pypy3-test-instrumentation-elasticsearch-6
|
||||
|
||||
; opentelemetry-instrumentation-falcon
|
||||
; py310 does not work with falcon 1
|
||||
@ -452,9 +448,7 @@ commands_pre =
|
||||
sqlalchemy-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt
|
||||
sqlalchemy-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt
|
||||
|
||||
elasticsearch-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt
|
||||
elasticsearch-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt
|
||||
elasticsearch-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
|
||||
elasticsearch-6: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-6.txt
|
||||
|
||||
asyncio: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt
|
||||
|
||||
@ -617,7 +611,7 @@ commands_pre =
|
||||
# prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install
|
||||
# for your OS to install the required dependencies
|
||||
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt
|
||||
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt
|
||||
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-6.txt
|
||||
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt
|
||||
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt
|
||||
pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt
|
||||
|
Reference in New Issue
Block a user