Skip to content

Commit

Permalink
Merge branch 'main' into asgi-header-decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored Apr 28, 2023
2 parents 0e1b7bb + f46a6e1 commit 8f43c74
Show file tree
Hide file tree
Showing 126 changed files with 1,014 additions and 448 deletions.
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: 2d1f0b9f5fce62549d1338882f37b91b95881c75
CORE_REPO_SHA: 2387b4465d930b020df79692a8097e1d54b66ec1

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

## Unreleased

- `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735))
- Add request and response hooks for GRPC instrumentation (client only)
([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706))
- `opentelemetry-instrumentation-pymemcache` Update instrumentation to support pymemcache >4
([#1764](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1764))

### Added

- Add `excluded_urls` functionality to `urllib` and `urllib3` instrumentations
([#1733](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1733))
- Make Django request span attributes available for `start_span`.
([#1730](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1730))
- Make ASGI request span attributes available for `start_span`.
([#1762](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1762))

### Fixed

- Fix elasticsearch db.statement attribute to be sanitized by default
([#1758](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1758))
- Fix `AttributeError` when AWS Lambda handler receives a list event
([#1738](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1738))
- Fix `None does not implement middleware` error when there are no middlewares registered
([#1766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1766))

## Version 1.17.0/0.38b0 (2023-03-22)

### Added

- Add connection attributes to sqlalchemy connect span
Expand All @@ -29,6 +55,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix httpx resource warnings
([#1695](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1695))

### Changed

- `opentelemetry-instrumentation-requests` Replace `name_callback` and `span_callback` with standard `response_hook` and `request_hook` callbacks
([#670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/670))

## Version 1.16.0/0.37b0 (2023-02-17)

### Added
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.38b0.dev"
__version__ = "0.39b0.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.17.0.dev
version=1.18.0.dev

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

[prerelease]
version=0.38b0.dev
version=0.39b0.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.38b0.dev"
__version__ = "0.39b0.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 @@ -27,7 +27,7 @@ classifiers = [
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-sdk ~= 1.12",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
2 changes: 1 addition & 1 deletion instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
| [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 | No
| [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No
| [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No
| [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 4 | No
| [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 5 | No
| [opentelemetry-instrumentation-pymongo](./opentelemetry-instrumentation-pymongo) | pymongo >= 3.1, < 5.0 | No
| [opentelemetry-instrumentation-pymysql](./opentelemetry-instrumentation-pymysql) | PyMySQL < 2 | No
| [opentelemetry-instrumentation-pyramid](./opentelemetry-instrumentation-pyramid) | pyramid >= 1.7 | Yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-aio-pika[instruments]",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-test-utils == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-util-http == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
"opentelemetry-util-http == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_status_codes(self):
(span_status, None),
{
SpanAttributes.HTTP_METHOD: "GET",
SpanAttributes.HTTP_URL: f"http://{host}:{port}/test-path?query=param#foobar",
SpanAttributes.HTTP_URL: f"http://{host}:{port}/test-path#foobar",
SpanAttributes.HTTP_STATUS_CODE: int(
status_code
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-instrumentation-dbapi == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-instrumentation-dbapi == 0.39b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -37,8 +37,8 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-aiopg[instruments]",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
"opentelemetry-test-utils == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ classifiers = [
dependencies = [
"asgiref ~= 3.0",
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-util-http == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
"opentelemetry-util-http == 0.39b0.dev",
]

[project.optional-dependencies]
Expand All @@ -38,7 +38,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-asgi[instruments]",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-test-utils == 0.39b0.dev",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,16 @@ async def __call__(self, scope, receive, send):

span_name, additional_attributes = self.default_span_details(scope)

attributes = collect_request_attributes(scope)
attributes.update(additional_attributes)
span, token = _start_internal_or_server_span(
tracer=self.tracer,
span_name=span_name,
start_time=None,
context_carrier=scope,
context_getter=asgi_getter,
attributes=attributes,
)
attributes = collect_request_attributes(scope)
attributes.update(additional_attributes)
active_requests_count_attrs = _parse_active_request_count_attrs(
attributes
)
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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
]

[project.optional-dependencies]
Expand All @@ -36,7 +36,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-asyncpg[instruments]",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-test-utils == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ classifiers = [
"Programming Language :: Python :: 3.8",
]
dependencies = [
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-propagator-aws-xray == 1.0.1",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
]

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

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches
# 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
# https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-server-semantic-conventions
if lambda_event and lambda_event.get("requestContext"):
if isinstance(lambda_event, dict) and lambda_event.get(
"requestContext"
):
span.set_attribute(SpanAttributes.FAAS_TRIGGER, "http")

if lambda_event.get("version") == "2.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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,15 @@ def test_api_gateway_http_api_proxy_event_sets_attributes(self):
},
)

def test_lambda_handles_list_event(self):
AwsLambdaInstrumentor().instrument()

mock_execute_lambda([{"message": "test"}])

spans = self.memory_exporter.get_finished_spans()

assert spans

def test_uninstrument(self):
AwsLambdaInstrumentor().instrument()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
]

[project.optional-dependencies]
Expand All @@ -38,7 +38,7 @@ test = [
"opentelemetry-instrumentation-boto[instruments]",
"markupsafe==2.0.1",
"moto~=2.0",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-test-utils == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -37,7 +37,7 @@ instruments = [
]
test = [
"opentelemetry-instrumentation-boto3sqs[instruments]",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-test-utils == 0.39b0.dev",
]

[project.entry-points.opentelemetry_instrumentor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Boto3SQSInstrumentor(BaseInstrumentor):
class ContextableList(list):
"""
Since the classic way to process SQS messages is using a `for` loop, without a well defined scope like a
callback - we are doing something similar to the instrumentaiton of Kafka-python and instrumenting the
callback - we are doing something similar to the instrumentation of Kafka-python and instrumenting the
`__iter__` functions and the `__getitem__` functions to set the span context of the addressed message. Since
the return value from an `SQS.ReceiveMessage` returns a builtin list, we cannot wrap it and change all of the
calls for `list.__iter__` and `list.__getitem__` - therefore we use ContextableList. It is bound to the
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.38b0.dev"
__version__ = "0.39b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.38b0.dev",
"opentelemetry-semantic-conventions == 0.38b0.dev",
"opentelemetry-instrumentation == 0.39b0.dev",
"opentelemetry-semantic-conventions == 0.39b0.dev",
]

[project.optional-dependencies]
Expand All @@ -38,7 +38,7 @@ test = [
"opentelemetry-instrumentation-botocore[instruments]",
"markupsafe==2.0.1",
"moto[all] ~= 2.2.6",
"opentelemetry-test-utils == 0.38b0.dev",
"opentelemetry-test-utils == 0.39b0.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.38b0.dev"
__version__ = "0.39b0.dev"
Loading

0 comments on commit 8f43c74

Please sign in to comment.