Skip to content

Commit

Permalink
Merge branch 'main' into enable-commenter-instrument-connection
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi authored Dec 19, 2024
2 parents b3ae9c8 + 54cbf59 commit 64941f9
Show file tree
Hide file tree
Showing 161 changed files with 1,310 additions and 999 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `opentelemetry-instrumentation-confluent-kafka` Add support for confluent-kafka <=2.7.0
([#3100](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3100))
- Add support to database stability opt-in in `_semconv` utilities and add tests
([#3111](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3111))

### Fixed

- `opentelemetry-instrumentation-httpx` Fix `RequestInfo`/`ResponseInfo` type hints
([#3105](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3105))


## Version 1.29.0/0.50b0 (2024-12-11)

### Added

- `opentelemetry-instrumentation-starlette` Add type hints to the instrumentation
([#3045](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3045))
- `opentelemetry-distro` default to OTLP log exporter.
Expand Down
20 changes: 18 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ You can run `tox` with the following arguments:

* `tox` to run all existing tox commands, including unit tests for all packages
under multiple Python versions
* `tox -e docs` to regenerate the API docs
* `tox -e docs` to regenerate all docs
* `tox -e py312-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific
Python version
* `tox -e spellcheck` to run a spellcheck on all the code
Expand All @@ -89,7 +89,9 @@ for more detail on available tox commands.

### Troubleshooting

> Some packages may require additional system wide dependencies to be installed. For example, you may need to install `libpq-dev` to run the postgresql client libraries instrumentation tests. or `libsnappy-dev` to run the prometheus exporter tests. If you encounter a build error, please check the installation instructions for the package you are trying to run tests for.
Some packages may require additional system-wide dependencies to be installed. For example, you may need to install `libpq-dev` to run the postgresql client libraries instrumentation tests or `libsnappy-dev` to run the prometheus exporter tests. If you encounter a build error, please check the installation instructions for the package you are trying to run tests for.

For `docs` building, you may need to install `mysql-client` and other required dependencies as necessary. Ensure the Python version used in your local setup matches the version used in the [CI](./.github/workflows/) to maintain compatibility when building the documentation.

### Benchmarks

Expand Down Expand Up @@ -278,6 +280,20 @@ Below is a checklist of things to be mindful of when implementing a new instrume
- Testing
- When adding a new instrumentation remember to update `tox.ini` adding appropriate rules in `envlist`, `command_pre` and `commands` sections

### Update supported instrumentation package versions

- Navigate to the **instrumentation package directory:**
- Update **`pyproject.toml`** file by modifying _instruments_ entry in the `[project.optional-dependencies]` section with the new version constraint
- Update `_instruments` variable in instrumentation **`package.py`** file with the new version constraint
- At the **root of the project directory**, run `tox -e generate` to regenerate necessary files

If you're adding support for a new version of the instrumentation package, follow these additional steps:

- At the **instrumentation package directory:** Add new test-requirements.txt file with the respective package version required for testing
- At the **root of the project directory**: Add a new test environment entry for the package version in [tox.ini](./tox.ini) and run `tox -e generate-workflows` to regenerate new workflows accordingly. In the same [tox.ini](./tox.ini) file, search for `opentelemetry-instrumentation-{package}/test-requirements` and add a new line to point to the new test-requirements.txt you created in the previous step so tox can install the correct requirements.

Example PRs: [#2976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2976), [#2845](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2845)

## Guideline for GenAI instrumentations

Instrumentations that relate to [Generative AI](https://opentelemetry.io/docs/specs/semconv/gen-ai/) systems will be placed in the [instrumentation-genai](./instrumentation-genai) folder. This section covers contributions related to those instrumentations. Please note that the [guidelines for instrumentations](#guideline-for-instrumentations) and [expectations from contributors](#expectations-from-contributors) still apply.
Expand Down
1 change: 1 addition & 0 deletions _template/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ REPLACE_ME = "opentelemetry.instrumentation.<REPLACE>"
# url of the instrumentation e.g
# Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-sqlalchemy"
Homepage = "<REPLACE ME>"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
# REPLACE ME: the path to the version file e.g
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.50b0.dev"
__version__ = "0.51b0.dev"
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pytest==7.4.4
pytest-cov==4.1.0
readme-renderer==42.0
bleach==4.1.0 # transient dependency for readme-renderer
protobuf~=3.13
markupsafe>=2.0.1
codespell==2.1.0
requests==2.32.3
Expand Down
2 changes: 2 additions & 0 deletions docs/nitpick-exceptions.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ py-class=
httpx.SyncByteStream
httpx.AsyncByteStream
httpx.Response
httpx.URL
httpx.Headers
aiohttp.web_request.Request
yarl.URL
cimpl.Producer
Expand Down
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.29.0.dev
version=1.30.0.dev

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

[prerelease]
version=0.50b0.dev
version=0.51b0.dev

packages=
all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-prometheus-remote-write"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/exporter/prometheus_remote_write/version.py"
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.50b0.dev"
__version__ = "0.51b0.dev"
3 changes: 2 additions & 1 deletion exporter/opentelemetry-exporter-richconsole/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ classifiers = [
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-sdk ~= 1.12",
"opentelemetry-semantic-conventions == 0.50b0.dev",
"opentelemetry-semantic-conventions == 0.51b0.dev",
"rich>=10.0.0",
]

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-richconsole"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/exporter/richconsole/version.py"
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.50b0.dev"
__version__ = "0.51b0.dev"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
openai~=1.54.4
openai~=1.57.3

opentelemetry-sdk~=1.28.2
opentelemetry-exporter-otlp-proto-grpc~=1.28.2
opentelemetry-sdk~=1.29.0
opentelemetry-exporter-otlp-proto-grpc~=1.29.0
opentelemetry-instrumentation-openai-v2~=2.0b0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openai~=1.54.4
openai~=1.57.3

opentelemetry-sdk~=1.28.2
opentelemetry-exporter-otlp-proto-grpc~=1.28.2
opentelemetry-distro~=0.49b2
opentelemetry-sdk~=1.29.0
opentelemetry-exporter-otlp-proto-grpc~=1.29.0
opentelemetry-distro~=0.50b0
opentelemetry-instrumentation-openai-v2~=2.0b0
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ openai = "opentelemetry.instrumentation.openai_v2:OpenAIInstrumentor"

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation-genai/opentelemetry-instrumentation-openai-v2"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/instrumentation/openai_v2/version.py"
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | experimental
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No | experimental
| [opentelemetry-instrumentation-click](./opentelemetry-instrumentation-click) | click >= 8.1.3, < 9.0.0 | No | experimental
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.4.0 | No | experimental
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.7.0 | No | experimental
| [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | experimental
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | experimental
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 6.0 | No | experimental
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.5",
"opentelemetry-instrumentation == 0.50b0.dev",
"opentelemetry-instrumentation == 0.51b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -40,6 +40,7 @@ aio-pika = "opentelemetry.instrumentation.aio_pika:AioPikaInstrumentor"

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aio-pika"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/instrumentation/aio_pika/version.py"
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.50b0.dev"
__version__ = "0.51b0.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.50b0.dev",
"opentelemetry-semantic-conventions == 0.50b0.dev",
"opentelemetry-util-http == 0.50b0.dev",
"opentelemetry-instrumentation == 0.51b0.dev",
"opentelemetry-semantic-conventions == 0.51b0.dev",
"opentelemetry-util-http == 0.51b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -42,6 +42,7 @@ aiohttp-client = "opentelemetry.instrumentation.aiohttp_client:AioHttpClientInst

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiohttp-client"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/instrumentation/aiohttp_client/version.py"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def response_hook(span: Span, params: typing.Union[
from opentelemetry import trace
from opentelemetry.instrumentation._semconv import (
_get_schema_url,
_HTTPStabilityMode,
_OpenTelemetrySemanticConventionStability,
_OpenTelemetryStabilitySignalType,
_report_new,
_set_http_method,
_set_http_url,
_set_status,
_StabilityMode,
)
from opentelemetry.instrumentation.aiohttp_client.package import _instruments
from opentelemetry.instrumentation.aiohttp_client.version import __version__
Expand Down Expand Up @@ -142,7 +142,7 @@ def _set_http_status_code_attribute(
span,
status_code,
metric_attributes=None,
sem_conv_opt_in_mode=_HTTPStabilityMode.DEFAULT,
sem_conv_opt_in_mode=_StabilityMode.DEFAULT,
):
status_code_str = str(status_code)
try:
Expand All @@ -169,7 +169,7 @@ def create_trace_config(
request_hook: _RequestHookT = None,
response_hook: _ResponseHookT = None,
tracer_provider: TracerProvider = None,
sem_conv_opt_in_mode: _HTTPStabilityMode = _HTTPStabilityMode.DEFAULT,
sem_conv_opt_in_mode: _StabilityMode = _StabilityMode.DEFAULT,
) -> aiohttp.TraceConfig:
"""Create an aiohttp-compatible trace configuration.
Expand Down Expand Up @@ -326,7 +326,7 @@ def _instrument(
trace_configs: typing.Optional[
typing.Sequence[aiohttp.TraceConfig]
] = None,
sem_conv_opt_in_mode: _HTTPStabilityMode = _HTTPStabilityMode.DEFAULT,
sem_conv_opt_in_mode: _StabilityMode = _StabilityMode.DEFAULT,
):
"""Enables tracing of all ClientSessions
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.50b0.dev"
__version__ = "0.51b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from opentelemetry.instrumentation import aiohttp_client
from opentelemetry.instrumentation._semconv import (
OTEL_SEMCONV_STABILITY_OPT_IN,
_HTTPStabilityMode,
_OpenTelemetrySemanticConventionStability,
_StabilityMode,
)
from opentelemetry.instrumentation.aiohttp_client import (
AioHttpClientInstrumentor,
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_status_codes_new_semconv(self):
path = "test-path?query=param#foobar"
host, port = self._http_request(
trace_config=aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP
sem_conv_opt_in_mode=_StabilityMode.HTTP
),
url=f"/{path}",
status_code=status_code,
Expand All @@ -173,7 +173,7 @@ def test_status_codes_both_semconv(self):
path = "test-path?query=param#foobar"
host, port = self._http_request(
trace_config=aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP_DUP
sem_conv_opt_in_mode=_StabilityMode.HTTP_DUP
),
url=f"/{path}",
status_code=status_code,
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_schema_url_new_semconv(self):
with self.subTest(status_code=200):
self._http_request(
trace_config=aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP
sem_conv_opt_in_mode=_StabilityMode.HTTP
),
url="/test-path?query=param#foobar",
status_code=200,
Expand All @@ -230,7 +230,7 @@ def test_schema_url_both_semconv(self):
with self.subTest(status_code=200):
self._http_request(
trace_config=aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP_DUP
sem_conv_opt_in_mode=_StabilityMode.HTTP_DUP
),
url="/test-path?query=param#foobar",
status_code=200,
Expand Down Expand Up @@ -398,7 +398,7 @@ async def request_handler(request):

host, port = self._http_request(
trace_config=aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP
sem_conv_opt_in_mode=_StabilityMode.HTTP
),
url="/test",
request_handler=request_handler,
Expand Down Expand Up @@ -426,7 +426,7 @@ async def request_handler(request):

host, port = self._http_request(
trace_config=aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP_DUP
sem_conv_opt_in_mode=_StabilityMode.HTTP_DUP
),
url="/test",
request_handler=request_handler,
Expand Down Expand Up @@ -546,7 +546,7 @@ async def do_request(url):
def test_nonstandard_http_method_new_semconv(self):
trace_configs = [
aiohttp_client.create_trace_config(
sem_conv_opt_in_mode=_HTTPStabilityMode.HTTP
sem_conv_opt_in_mode=_StabilityMode.HTTP
)
]
app = HttpServerMock("nonstandard_method")
Expand Down
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.50b0.dev",
"opentelemetry-semantic-conventions == 0.50b0.dev",
"opentelemetry-util-http == 0.50b0.dev",
"opentelemetry-instrumentation == 0.51b0.dev",
"opentelemetry-semantic-conventions == 0.51b0.dev",
"opentelemetry-util-http == 0.51b0.dev",
"wrapt >= 1.0.0, < 2.0.0",
]

Expand All @@ -42,6 +42,7 @@ aiohttp-server = "opentelemetry.instrumentation.aiohttp_server:AioHttpServerInst

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiohttp-server"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/instrumentation/aiohttp_server/version.py"
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.50b0.dev"
__version__ = "0.51b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ classifiers = [
]
dependencies = [
"opentelemetry-api ~= 1.27",
"opentelemetry-instrumentation == 0.50b0.dev",
"opentelemetry-semantic-conventions == 0.50b0.dev",
"opentelemetry-instrumentation == 0.51b0.dev",
"opentelemetry-semantic-conventions == 0.51b0.dev",
]

[project.optional-dependencies]
Expand All @@ -38,6 +38,7 @@ aiokafka = "opentelemetry.instrumentation.aiokafka:AIOKafkaInstrumentor"

[project.urls]
Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiokafka"
Repository = "https://github.com/open-telemetry/opentelemetry-python-contrib"

[tool.hatch.version]
path = "src/opentelemetry/instrumentation/aiokafka/version.py"
Expand Down
Loading

0 comments on commit 64941f9

Please sign in to comment.