Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
martimors authored Apr 22, 2024
2 parents 201470f + ad06e70 commit 4075173
Show file tree
Hide file tree
Showing 278 changed files with 5,123 additions and 1,373 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: a1253585f66d63e7c05a19f070f3bfe0ab6460c1
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2

jobs:
instrumentations-0:
Expand Down
6 changes: 3 additions & 3 deletions .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: a1253585f66d63e7c05a19f070f3bfe0ab6460c1
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2

jobs:
instrumentations-1:
Expand All @@ -25,13 +25,13 @@ jobs:
python-version: [py38, py39, py310, py311, pypy3]
package:
- "urllib"
- "urllib3v"
- "urllib3"
- "wsgi"
- "distro"
- "richconsole"
- "psycopg"
- "prometheus-remote-write"
- "sdkextension-aws"
- "sdk-extension-aws"
- "propagator-aws-xray"
- "propagator-ot-trace"
- "resource-detector-container"
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Shellcheck

on:
push:
branches-ignore:
- 'release/*'
pull_request:

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install shellcheck
run: sudo apt update && sudo apt install --assume-yes shellcheck

- name: Run shellcheck
run: find . -name \*.sh | xargs shellcheck --severity=warning
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: a1253585f66d63e7c05a19f070f3bfe0ab6460c1
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2

jobs:
misc:
Expand Down
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ disable=missing-docstring,
missing-module-docstring, # temp-pylint-upgrade
import-error, # needed as a workaround as reported here: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/290
cyclic-import,
not-context-manager

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ sphinx:
configuration: docs/conf.py

build:
image: latest
os: "ubuntu-22.04"
tools:
python: "3.8"

python:
version: 3.8
install:
- requirements: docs-requirements.txt
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,72 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- `opentelemetry-instrumentation-pika` Instrumentation for `channel.consume()` (supported
only for global, non channel specific instrumentation)
([#2397](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2397)))


### Breaking changes

- Rename `type` attribute to `asgi.event.type` in `opentelemetry-instrumentation-asgi`
([#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

- `opentelemetry-sdk-extension-aws` Register AWS resource detectors under the
`opentelemetry_resource_detector` entry point
([#2382](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2382))
- `opentelemetry-instrumentation-wsgi` Implement new semantic convention opt-in with stable http semantic conventions
([#2425](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2425))
- `opentelemetry-instrumentation-threading` Initial release for threading
([#2253](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2253))

### Fixed

- `opentelemetry-instrumentation-grpc` AioClientInterceptor should propagate with a Metadata object
([#2363](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2363))

### Added

- `opentelemetry-sdk-extension-aws` Register AWS resource detectors under the `opentelemetry_resource_detector` entry point
([#2382](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2382))
- `opentelemetry-instrumentation-wsgi` Implement new semantic convention opt-in with stable http semantic conventions
([#2425](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2425))
- `opentelemetry-instrumentation-threading` Initial release for threading
([#2253](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2253))

## Version 1.24.0/0.45b0 (2024-03-28)

### Added

- `opentelemetry-instrumentation-psycopg` Async Instrumentation for psycopg 3.x
([#2146](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2146))

### Fixed
- `opentelemetry-instrumentation-celery` Allow Celery instrumentation to be installed multiple times
([#2342](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2342))
- Align gRPC span status codes to OTEL specification
([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756))
- `opentelemetry-instrumentation-flask` Add importlib metadata default for deprecation warning flask version
([#2297](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2297))
- Ensure all http.server.duration metrics have the same description
([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2298))
- Fix regression in httpx `request.url` not being of type `httpx.URL` after `0.44b0`
([#2359](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2359))
- Avoid losing repeated HTTP headers
([#2266](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2266))
- `opentelemetry-instrumentation-elasticsearch` Don't send bulk request body as db statement
([#2355](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2355))
- AwsLambdaInstrumentor sets `cloud.account.id` span attribute
([#2367](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2367))


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

- Drop support for 3.7
Expand Down
57 changes: 37 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,26 @@ on how to become a [**Member**](https://github.com/open-telemetry/community/blob
[**Approver**](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver)
and [**Maintainer**](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).

## Find a Buddy and get Started Quickly!
## Index

* [Find a Buddy and get Started Quickly](#find-a-buddy-and-get-started-quickly)
* [Development](#development)
* [Troubleshooting](#troubleshooting)
* [Benchmarks](#benchmarks)
* [Pull requests](#pull-requests)
* [How to Send Pull Requests](#how-to-send-pull-requests)
* [How to Receive Comments](#how-to-receive-comments)
* [How to Get PRs Reviewed](#how-to-get-prs-reviewed)
* [How to Get PRs Merged](#how-to-get-prs-merged)
* [Design Choices](#design-choices)
* [Focus on Capabilities, Not Structure Compliance](#focus-on-capabilities-not-structure-compliance)
* [Running Tests Locally](#running-tests-locally)
* [Testing against a different Core repo branch/commit](#testing-against-a-different-core-repo-branchcommit)
* [Style Guide](#style-guide)
* [Guideline for instrumentations](#guideline-for-instrumentations)
* [Expectations from contributors](#expectations-from-contributors)

## Find a Buddy and get Started Quickly

If you are looking for someone to help you find a starting point and be a resource for your first contribution, join our
Slack and find a buddy!
Expand All @@ -31,8 +50,8 @@ This project uses [tox](https://tox.readthedocs.io) to automate
some aspects of development, including testing against multiple Python versions.
To install `tox`, run:

```console
$ pip install tox
```sh
pip install tox
```

You can run `tox` with the following arguments:
Expand All @@ -57,7 +76,7 @@ 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.
### Benchmarks

Expand Down Expand Up @@ -94,13 +113,13 @@ pull requests (PRs).
To create a new PR, fork the project in GitHub and clone the upstream repo:

```sh
$ git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git
git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git
```

Add your fork as an origin:

```sh
$ git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-python-contrib.git
git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-python-contrib.git
```

Run tests:
Expand All @@ -114,10 +133,10 @@ $ tox # execute in the root of the repository
Check out a new branch, make modifications and push the branch to your fork:

```sh
$ git checkout -b feature
git checkout -b feature
# edit files
$ git commit
$ git push fork feature
git commit
git push fork feature
```

Open a pull request against the main `opentelemetry-python-contrib` repo.
Expand All @@ -142,6 +161,7 @@ If you are not getting reviews, please contact the respective owners directly.
### How to Get PRs Merged

A PR is considered to be **ready to merge** when:

* It has received two approvals from [Approvers](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver)
/ [Maintainers](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer)
(at different companies).
Expand Down Expand Up @@ -186,8 +206,7 @@ Some of the tox targets install packages from the [OpenTelemetry Python Core Rep

CORE_REPO_SHA=c49ad57bfe35cfc69bfa863d74058ca9bec55fc3 tox

The continuation integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/test.yml#L9).

The continuation integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/.github/workflows/test.yml#L9).

## Style Guide

Expand All @@ -203,27 +222,25 @@ Below is a checklist of things to be mindful of when implementing a new instrume

- Follow semantic conventions
- The instrumentation should follow the semantic conventions defined [here](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/semantic-conventions.md)
- Extends from [BaseInstrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py#L26)
- Extends from [BaseInstrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py#L35)
- Supports auto-instrumentation
- Add an entry point (ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/f045c43affff6ff1af8fa2f7514a4fdaca97dacf/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml#L44)
- Add an entry point (ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml#L44>)
- Run `python scripts/generate_instrumentation_bootstrap.py` after adding a new instrumentation package.
- Functionality that is common amongst other instrumentation and can be abstracted [here](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation)
- Request/response [hooks](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/408) for http instrumentations
- `suppress_instrumentation` functionality
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/3ec77360cb20482b08b30312a6bedc8b946e3fa1/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L111
- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py#L191>
- Suppress propagation functionality
- https://github.com/open-telemetry/opentelemetry-python-contrib/issues/344 for more context
- `exclude_urls` functionality
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py#L91
- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py#L327>
- `url_filter` functionality
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py#L235
- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py#L268>
- `is_recording()` optimization on non-sampled spans
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L133
- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L234>
- Appropriate error handling
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L146

- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L220>

## Expectations from contributors

OpenTelemetry is an open source community, and as such, greatly encourages contributions from anyone interested in the project. With that being said, there is a certain level of expectation from contributors even after a pull request is merged, specifically pertaining to instrumentations. The OpenTelemetry Python community expects contributors to maintain a level of support and interest in the instrumentations they contribute. This is to ensure that the instrumentation does not become stale and still functions the way the original contributor intended. Some instrumentations also pertain to libraries that the current members of the community are not so familiar with, so it is necessary to rely on the expertise of the original contributing parties.

Loading

0 comments on commit 4075173

Please sign in to comment.