Skip to content

Commit

Permalink
Merge branch 'main' into boto3sqs/resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mattoberle authored Feb 23, 2024
2 parents 556fdab + 1c21715 commit 0d7748b
Show file tree
Hide file tree
Showing 115 changed files with 384 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/instrumentations_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f
CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1

jobs:
instrumentations-0:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f
CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1

jobs:
instrumentations-1:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
echo "PRIOR_VERSION_WHEN_PATCH=$prior_version_when_patch" >> $GITHUB_ENV
# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v3
with:
ref: main

- run: |
if [[ -z $PRIOR_VERSION_WHEN_PATCH ]]; then
# not making a patch release
Expand All @@ -60,6 +54,12 @@ jobs:
fi
fi
# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v3
with:
ref: main

# back to the release branch
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f
CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1

jobs:
misc:
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `opentelemetry-instrumentation-boto3sqs` Instrument Session and resource
([#2161](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2161))

## Version 1.23.0/0.44b0 (2024-02-23)

- Drop support for 3.7
([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151))
- `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector
Expand All @@ -21,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136))
- `opentelemetry-resource-detector-azure` Suppress instrumentation for `urllib` call
([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178))
- AwsLambdaInstrumentor handles and re-raises function exception ([#2245](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2245))

## Version 1.22.0/0.43b0 (2023-12-14)

Expand Down Expand Up @@ -1446,3 +1450,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `opentelemetry-ext-wsgi` Initial release
- `opentelemetry-ext-http-requests` Initial release

- Drop support for 3.7
([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151))
- `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector
([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119))
- `opentelemetry-instrumentation-asyncpg` Allow AsyncPGInstrumentor to be instantiated multiple times
([#1791](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1791))
- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions until 2.3.0 of confluent_kafka
([#2132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2132))
- `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644)
([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136))
- `opentelemetry-resource-detector-azure` Suppress instrumentation for `urllib` call
([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178))
- AwsLambdaInstrumentor handles and re-raises function exception ([#2245](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2245))

4 changes: 3 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
* If making a pre-release of stable components (e.g. release candidate),
enter the pre-release version number, e.g. `1.9.0rc2`.
(otherwise the workflow will pick up the version from `main` and just remove the `.dev` suffix).
* Review and merge the two pull requests that it creates
* Review the two pull requests that it creates.
(one is targeted to the release branch and one is targeted to `main`).
* Merge the one targeted towards the release branch.
* The builds will fail for the `main` pr because of validation rules. Follow the [release workflow](https://github.com/open-telemetry/opentelemetry-python/blob/main/RELEASING.md) for the core repo up until this same point. Change the SHAs of each PR to point at each other to get the `main` builds to pass.

## Preparing a new patch release

Expand Down
2 changes: 1 addition & 1 deletion _template/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
4 changes: 2 additions & 2 deletions eachdist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sortfirst=
ext/*

[stable]
version=1.23.0.dev
version=1.24.0.dev

packages=
opentelemetry-sdk
Expand All @@ -34,7 +34,7 @@ packages=
opentelemetry-api

[prerelease]
version=0.44b0.dev
version=0.45b0.dev

packages=
all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
2 changes: 1 addition & 1 deletion exporter/opentelemetry-exporter-richconsole/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-sdk ~= 1.12",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"rich>=10.0.0",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.5",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -35,7 +35,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-aio-pika[instruments]",
"opentelemetry-test-utils == 0.44b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
"pytest",
"wrapt >= 1.0.0, < 2.0.0",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-util-http == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"opentelemetry-util-http == 0.45b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-util-http == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"opentelemetry-util-http == 0.45b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-instrumentation-dbapi == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-instrumentation-dbapi == 0.45b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -36,8 +36,8 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-aiopg[instruments]",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-test-utils == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
]

[project.entry-points.opentelemetry_instrumentor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ classifiers = [
dependencies = [
"asgiref ~= 3.0",
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-util-http == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"opentelemetry-util-http == 0.45b0.dev",
]

[project.optional-dependencies]
Expand All @@ -37,7 +37,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-asgi[instruments]",
"opentelemetry-test-utils == 0.44b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.14",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-test-utils == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
]

[project.optional-dependencies]
Expand All @@ -35,7 +35,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-asyncpg[instruments]",
"opentelemetry-test-utils == 0.44b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
]

[project.entry-points.opentelemetry_instrumentor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ classifiers = [
"Programming Language :: Python :: 3.8",
]
dependencies = [
"opentelemetry-instrumentation == 0.44b0.dev",
"opentelemetry-instrumentation == 0.45b0.dev",
"opentelemetry-propagator-aws-xray == 1.0.1",
"opentelemetry-semantic-conventions == 0.44b0.dev",
"opentelemetry-semantic-conventions == 0.45b0.dev",
]

[project.optional-dependencies]
instruments = []
test = [
"opentelemetry-test-utils == 0.44b0.dev",
"opentelemetry-test-utils == 0.45b0.dev",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def custom_event_context_extractor(lambda_event):
get_tracer_provider,
)
from opentelemetry.trace.propagation import get_current_span
from opentelemetry.trace.status import Status, StatusCode

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -278,6 +279,7 @@ def _set_api_gateway_v2_proxy_attributes(
return span


# pylint: disable=too-many-statements
def _instrument(
wrapped_module_name,
wrapped_function_name,
Expand All @@ -287,6 +289,8 @@ def _instrument(
disable_aws_context_propagation: bool = False,
meter_provider: MeterProvider = None,
):
# pylint: disable=too-many-locals
# pylint: disable=too-many-statements
def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches
call_wrapped, instance, args, kwargs
):
Expand Down Expand Up @@ -350,7 +354,13 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches
lambda_context.aws_request_id,
)

result = call_wrapped(*args, **kwargs)
exception = None
try:
result = call_wrapped(*args, **kwargs)
except Exception as exc: # pylint: disable=W0703
exception = exc
span.set_status(Status(StatusCode.ERROR))
span.record_exception(exception)

# If the request came from an API Gateway, extract http attributes from the event
# https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#api-gateway
Expand Down Expand Up @@ -398,6 +408,9 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches
"MeterProvider was missing `force_flush` method. This is necessary in case of a Lambda freeze and would exist in the OTel SDK implementation."
)

if exception is not None:
raise exception.with_traceback(exception.__traceback__)

return result

wrap_function_wrapper(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.44b0.dev"
__version__ = "0.45b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ def handler(event, context):

def rest_api_handler(event, context):
return {"statusCode": 200, "body": "200 ok"}


def handler_exc(event, context):
raise Exception("500 internal server error")
Loading

0 comments on commit 0d7748b

Please sign in to comment.