Skip to content

Commit a294d7f

Browse files
authored
Merge branch 'main' into main
2 parents d3e3a1e + 9ce1c26 commit a294d7f

File tree

18 files changed

+111
-82
lines changed

18 files changed

+111
-82
lines changed

.github/workflows/shellcheck.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Shellcheck
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
9+
jobs:
10+
shellcheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install shellcheck
16+
run: sudo apt update && sudo apt install --assume-yes shellcheck
17+
18+
- name: Run shellcheck
19+
run: find . -name \*.sh | xargs shellcheck --severity=warning

.readthedocs.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ sphinx:
66
configuration: docs/conf.py
77

88
build:
9-
image: latest
9+
os: "ubuntu-22.04"
10+
tools:
11+
python: "3.8"
1012

1113
python:
12-
version: 3.8
1314
install:
1415
- requirements: docs-requirements.txt

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
- Rename `type` attribute to `asgi.event.type` in `opentelemetry-instrumentation-asgi`
1616
([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300))
17+
- Rename AwsLambdaInstrumentor span attributes `faas.id` to `cloud.resource_id`, `faas.execution` to `faas.invocation_id`
18+
([#2372](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2372))
1719

1820
### Added
1921

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,15 @@ To release a package as `1.0` stable, the package:
9696
- e.g. If an instrumentation package uses flags, a token as context, or parameters that are not typical of the `BaseInstrumentor` class, these are documented
9797
- After the release of `1.0`, a CODEOWNER may no longer feel like they have the bandwidth to meet the responsibilities of maintaining the package. That's not a problem at all, life happens! However, if that is the case, we ask that the CODEOWNER please raise an issue indicating that they would like to be removed as a CODEOWNER so that they don't get pinged on future PRs. Ultimately, we hope to use that issue to find a new CODEOWNER.
9898

99+
## Semantic Convention status of instrumentations
100+
101+
In our efforts to maintain optimal user experience and prevent breaking changes for transitioning into stable semantic conventions, OpenTelemetry Python is adopting the [semantic convention migration plan](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/migration-guide.md) for several instrumentations. Currently this plan is only being adopted for HTTP-related instrumentations, but will eventually cover all types. Please refer to the `semconv status` column of the [instrumentation README](instrumentation/README.md) of the current status of instrumentations' semantic conventions. The possible values are `experimental`, `stable` and `migration` referring to [status](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.31.0/specification/document-status.md#lifecycle-status) of that particular semantic convention. `Migration` refers to an instrumentation that currently supports the migration plan.
102+
99103
## Contributing
100104

101105
See [CONTRIBUTING.md](CONTRIBUTING.md)
102106

103-
We meet weekly on Thursday, and the time of the meeting alternates between 9AM PT and 4PM PT. The meeting is subject to change depending on contributors' availability. Check the [OpenTelemetry community calendar](https://calendar.google.com/calendar/embed?src=google.com_b79e3e90j7bbsa2n2p5an5lf60%40group.calendar.google.com) for specific dates and for the Zoom link.
107+
We meet weekly on Thursday at 9AM PT. The meeting is subject to change depending on contributors' availability. Check the [OpenTelemetry community calendar](https://calendar.google.com/calendar/embed?src=c_2bf73e3b6b530da4babd444e72b76a6ad893a5c3f43cf40467abc7a9a897f977%40group.calendar.google.com) for specific dates and for the Zoom link.
104108

105109
Meeting notes are available as a public [Google doc](https://docs.google.com/document/d/1CIMGoIOZ-c3-igzbd6_Pnxx1SjAkjwqoYSUWxPY8XIs/edit). For edit access, get in touch on [GitHub Discussions](https://github.com/open-telemetry/opentelemetry-python/discussions).
106110

exporter/opentelemetry-exporter-prometheus-remote-write/proto/generate-proto-py.sh

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ PROTO_VERSION=v1.3.2
66

77
# SRC_DIR is from protoc perspective. ie its the destination for our checkouts/clones
88
SRC_DIR=opentelemetry/exporter/prometheus_remote_write/gen/
9-
DST_DIR=../src/opentelemetry/exporter/prometheus_remote_write/gen/
109

1110
#TODO:
1211
# Check that black & protoc are installed properly

instrumentation/README.md

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11

2-
| Instrumentation | Supported Packages | Metrics support |
3-
| --------------- | ------------------ | --------------- |
4-
| [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika >= 7.2.0, < 10.0.0 | No
5-
| [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No
6-
| [opentelemetry-instrumentation-aiohttp-server](./opentelemetry-instrumentation-aiohttp-server) | aiohttp ~= 3.0 | No
7-
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No
8-
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No
9-
| [opentelemetry-instrumentation-asyncio](./opentelemetry-instrumentation-asyncio) | asyncio | No
10-
| [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No
11-
| [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No
12-
| [opentelemetry-instrumentation-boto](./opentelemetry-instrumentation-boto) | boto~=2.0 | No
13-
| [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No
14-
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No
15-
| [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No
16-
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No
17-
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.3.0 | No
18-
| [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No
19-
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes
20-
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No
21-
| [opentelemetry-instrumentation-falcon](./opentelemetry-instrumentation-falcon) | falcon >= 1.4.1, < 4.0.0 | Yes
22-
| [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58 | Yes
23-
| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0 | Yes
24-
| [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio ~= 1.27 | No
25-
| [opentelemetry-instrumentation-httpx](./opentelemetry-instrumentation-httpx) | httpx >= 0.18.0 | No
26-
| [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2 >= 2.7, < 4.0 | No
27-
| [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0 | No
28-
| [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging | No
29-
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 | No
30-
| [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No
31-
| [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No
32-
| [opentelemetry-instrumentation-psycopg](./opentelemetry-instrumentation-psycopg) | psycopg >= 3.1.0 | No
33-
| [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No
34-
| [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 5 | No
35-
| [opentelemetry-instrumentation-pymongo](./opentelemetry-instrumentation-pymongo) | pymongo >= 3.1, < 5.0 | No
36-
| [opentelemetry-instrumentation-pymysql](./opentelemetry-instrumentation-pymysql) | PyMySQL < 2 | No
37-
| [opentelemetry-instrumentation-pyramid](./opentelemetry-instrumentation-pyramid) | pyramid >= 1.7 | Yes
38-
| [opentelemetry-instrumentation-redis](./opentelemetry-instrumentation-redis) | redis >= 2.6 | No
39-
| [opentelemetry-instrumentation-remoulade](./opentelemetry-instrumentation-remoulade) | remoulade >= 0.50 | No
40-
| [opentelemetry-instrumentation-requests](./opentelemetry-instrumentation-requests) | requests ~= 2.0 | Yes
41-
| [opentelemetry-instrumentation-sklearn](./opentelemetry-instrumentation-sklearn) | scikit-learn ~= 0.24.0 | No
42-
| [opentelemetry-instrumentation-sqlalchemy](./opentelemetry-instrumentation-sqlalchemy) | sqlalchemy | Yes
43-
| [opentelemetry-instrumentation-sqlite3](./opentelemetry-instrumentation-sqlite3) | sqlite3 | No
44-
| [opentelemetry-instrumentation-starlette](./opentelemetry-instrumentation-starlette) | starlette ~= 0.13.0 | Yes
45-
| [opentelemetry-instrumentation-system-metrics](./opentelemetry-instrumentation-system-metrics) | psutil >= 5 | No
46-
| [opentelemetry-instrumentation-threading](./opentelemetry-instrumentation-threading) | threading | No
47-
| [opentelemetry-instrumentation-tornado](./opentelemetry-instrumentation-tornado) | tornado >= 5.1.1 | Yes
48-
| [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No
49-
| [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | Yes
50-
| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 3.0.0 | Yes
51-
| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes
2+
| Instrumentation | Supported Packages | Metrics support | Semconv status |
3+
| --------------- | ------------------ | --------------- | -------------- |
4+
| [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika >= 7.2.0, < 10.0.0 | No | experimental
5+
| [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No | experimental
6+
| [opentelemetry-instrumentation-aiohttp-server](./opentelemetry-instrumentation-aiohttp-server) | aiohttp ~= 3.0 | No | experimental
7+
| [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No | experimental
8+
| [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No | experimental
9+
| [opentelemetry-instrumentation-asyncio](./opentelemetry-instrumentation-asyncio) | asyncio | No | experimental
10+
| [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | experimental
11+
| [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No | experimental
12+
| [opentelemetry-instrumentation-boto](./opentelemetry-instrumentation-boto) | boto~=2.0 | No | experimental
13+
| [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No | experimental
14+
| [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No | experimental
15+
| [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | experimental
16+
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No | experimental
17+
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.3.0 | No | experimental
18+
| [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | experimental
19+
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | experimental
20+
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No | experimental
21+
| [opentelemetry-instrumentation-falcon](./opentelemetry-instrumentation-falcon) | falcon >= 1.4.1, < 4.0.0 | Yes | experimental
22+
| [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58 | Yes | experimental
23+
| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0 | Yes | experimental
24+
| [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio ~= 1.27 | No | experimental
25+
| [opentelemetry-instrumentation-httpx](./opentelemetry-instrumentation-httpx) | httpx >= 0.18.0 | No | experimental
26+
| [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2 >= 2.7, < 4.0 | No | experimental
27+
| [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0 | No | experimental
28+
| [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging | No | experimental
29+
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 | No | experimental
30+
| [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No | experimental
31+
| [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No | experimental
32+
| [opentelemetry-instrumentation-psycopg](./opentelemetry-instrumentation-psycopg) | psycopg >= 3.1.0 | No | experimental
33+
| [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No | experimental
34+
| [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 5 | No | experimental
35+
| [opentelemetry-instrumentation-pymongo](./opentelemetry-instrumentation-pymongo) | pymongo >= 3.1, < 5.0 | No | experimental
36+
| [opentelemetry-instrumentation-pymysql](./opentelemetry-instrumentation-pymysql) | PyMySQL < 2 | No | experimental
37+
| [opentelemetry-instrumentation-pyramid](./opentelemetry-instrumentation-pyramid) | pyramid >= 1.7 | Yes | experimental
38+
| [opentelemetry-instrumentation-redis](./opentelemetry-instrumentation-redis) | redis >= 2.6 | No | experimental
39+
| [opentelemetry-instrumentation-remoulade](./opentelemetry-instrumentation-remoulade) | remoulade >= 0.50 | No | experimental
40+
| [opentelemetry-instrumentation-requests](./opentelemetry-instrumentation-requests) | requests ~= 2.0 | Yes | migration
41+
| [opentelemetry-instrumentation-sklearn](./opentelemetry-instrumentation-sklearn) | scikit-learn ~= 0.24.0 | No | experimental
42+
| [opentelemetry-instrumentation-sqlalchemy](./opentelemetry-instrumentation-sqlalchemy) | sqlalchemy | Yes | experimental
43+
| [opentelemetry-instrumentation-sqlite3](./opentelemetry-instrumentation-sqlite3) | sqlite3 | No | experimental
44+
| [opentelemetry-instrumentation-starlette](./opentelemetry-instrumentation-starlette) | starlette ~= 0.13.0 | Yes | experimental
45+
| [opentelemetry-instrumentation-system-metrics](./opentelemetry-instrumentation-system-metrics) | psutil >= 5 | No | experimental
46+
| [opentelemetry-instrumentation-threading](./opentelemetry-instrumentation-threading) | threading | No | experimental
47+
| [opentelemetry-instrumentation-tornado](./opentelemetry-instrumentation-tornado) | tornado >= 5.1.1 | Yes | experimental
48+
| [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No | experimental
49+
| [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | Yes | experimental
50+
| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 3.0.0 | Yes | experimental
51+
| [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes | experimental

instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,17 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches
340340
if span.is_recording():
341341
lambda_context = args[1]
342342
# NOTE: The specs mention an exception here, allowing the
343-
# `ResourceAttributes.FAAS_ID` attribute to be set as a span
343+
# `SpanAttributes.CLOUD_RESOURCE_ID` attribute to be set as a span
344344
# attribute instead of a resource attribute.
345345
#
346346
# See more:
347-
# https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/faas.md#example
347+
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#resource-detector
348348
span.set_attribute(
349-
ResourceAttributes.FAAS_ID,
349+
SpanAttributes.CLOUD_RESOURCE_ID,
350350
lambda_context.invoked_function_arn,
351351
)
352352
span.set_attribute(
353-
SpanAttributes.FAAS_EXECUTION,
353+
SpanAttributes.FAAS_INVOCATION_ID,
354354
lambda_context.aws_request_id,
355355
)
356356

instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def test_active_tracing(self):
145145
self.assertSpanHasAttributes(
146146
span,
147147
{
148-
ResourceAttributes.FAAS_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn,
149-
SpanAttributes.FAAS_EXECUTION: MOCK_LAMBDA_CONTEXT.aws_request_id,
148+
SpanAttributes.CLOUD_RESOURCE_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn,
149+
SpanAttributes.FAAS_INVOCATION_ID: MOCK_LAMBDA_CONTEXT.aws_request_id,
150150
ResourceAttributes.CLOUD_ACCOUNT_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn.split(
151151
":"
152152
)[

instrumentation/opentelemetry-instrumentation-celery/tests/test_tasks.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ def test_task_raises(self):
125125

126126
self.assertIn(SpanAttributes.EXCEPTION_STACKTRACE, event.attributes)
127127

128-
self.assertEqual(
129-
event.attributes[SpanAttributes.EXCEPTION_TYPE], "CustomError"
128+
# TODO: use plain assertEqual after 1.25 is released (https://github.com/open-telemetry/opentelemetry-python/pull/3837)
129+
self.assertIn(
130+
"CustomError", event.attributes[SpanAttributes.EXCEPTION_TYPE]
130131
)
131132

132133
self.assertEqual(

instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
asgiref==3.7.2
22
attrs==23.2.0
33
Deprecated==1.2.14
4-
Django==3.2.24
4+
Django==3.2.25
55
importlib-metadata==6.11.0
66
iniconfig==2.0.0
77
packaging==23.2

instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ asgiref==3.7.2
22
attrs==23.2.0
33
backports.zoneinfo==0.2.1
44
Deprecated==1.2.14
5-
Django==4.2.10
5+
Django==4.2.11
66
importlib-metadata==6.11.0
77
iniconfig==2.0.0
88
packaging==23.2

instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
asgiref==3.7.2
22
attrs==23.2.0
33
Deprecated==1.2.14
4-
Django==4.2.10
4+
Django==4.2.11
55
importlib-metadata==6.11.0
66
iniconfig==2.0.0
77
packaging==23.2

instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/package.py

+2
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
_instruments = ("requests ~= 2.0",)
1717

1818
_supports_metrics = True
19+
20+
_semconv_status = "migration"

scripts/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ set -ev
88
# Get the latest versions of packaging tools
99
python3 -m pip install --upgrade pip build setuptools wheel
1010

11-
BASEDIR=$(dirname $(readlink -f $(dirname $0)))
11+
BASEDIR=$(dirname "$(readlink -f "$(dirname $0)")")
1212
DISTDIR=dist
1313

1414
(
1515
cd $BASEDIR
1616
mkdir -p $DISTDIR
17-
rm -rf $DISTDIR/*
17+
rm -rf ${DISTDIR:?}/*
1818

1919
for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ propagator/*/ resource/*/ sdk-extension/*/ util/*/ ; do
2020
(

scripts/build_a_package.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -ev
2222

2323
if [ -z $GITHUB_REF ]; then
2424
echo 'Failed to run script, missing workflow env variable GITHUB_REF.'
25-
exit -1
25+
exit 1
2626
fi
2727

2828
pkg_name_and_version=${GITHUB_REF#refs/tags/*}
@@ -40,13 +40,13 @@ cd $basedir
4040

4141
distdir=${basedir}/dist
4242
mkdir -p $distdir
43-
rm -rf $distdir/*
43+
rm -rf ${distdir:?}/*
4444

4545
pyproject_toml_file_path=$(ls **/$pkg_name/pyproject.toml)
4646

4747
if [ -z $pyproject_toml_file_path ]; then
4848
echo "Error! pyproject.toml not found for $pkg_name, can't build."
49-
exit -1
49+
exit 1
5050
fi
5151

5252
directory_with_package=$(dirname $pyproject_toml_file_path)
@@ -61,7 +61,7 @@ pkg_tar_gz_file=${pkg_name}-${pkg_version}.tar.gz
6161

6262
if ! [ -f $pkg_tar_gz_file ]; then
6363
echo 'Error! Tag version does not match version built using latest package files.'
64-
exit -1
64+
exit 1
6565
fi
6666

6767
# Build a wheel for the source distribution

scripts/coverage.sh

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ function cov {
1111
${1}
1212
}
1313

14-
PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
15-
PYTHON_VERSION_INFO=(${PYTHON_VERSION//./ })
16-
1714
coverage erase
1815

1916
cov instrumentation/opentelemetry-instrumentation-flask

0 commit comments

Comments
 (0)