Skip to content

Commit 6781a66

Browse files
authored
Merge branch 'main' into fix-sqlalchemy-engine-from-config-monkeypatching
2 parents 67db7b9 + 5c5fc73 commit 6781a66

File tree

73 files changed

+4710
-653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4710
-653
lines changed

.github/component_owners.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@ components:
7373
- lzchen
7474
- gyliu513
7575
- nirga
76+
- alizenhom
7677
- codefromthecrypt
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -e
2+
3+
sed -i "/\[stable\]/{n;s/version=.*/version=$1/}" eachdist.ini
4+
sed -i "/\[prerelease\]/{n;s/version=.*/version=$2/}" eachdist.ini
5+
6+
./scripts/eachdist.py update_patch_versions \
7+
--stable_version=$1 \
8+
--unstable_version=$2 \
9+
--stable_version_prev=$3 \
10+
--unstable_version_prev=$4
11+

.github/workflows/prepare-patch-release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ jobs:
4040
exit 1
4141
fi
4242
43+
stable_version_prev="$stable_major_minor.$((stable_patch))"
44+
unstable_version_prev="0.${unstable_minor}b$((unstable_patch))"
4345
stable_version="$stable_major_minor.$((stable_patch + 1))"
4446
unstable_version="0.${unstable_minor}b$((unstable_patch + 1))"
4547
4648
echo "STABLE_VERSION=$stable_version" >> $GITHUB_ENV
4749
echo "UNSTABLE_VERSION=$unstable_version" >> $GITHUB_ENV
50+
echo "STABLE_VERSION_PREV=$stable_version_prev" >> $GITHUB_ENV
51+
echo "UNSTABLE_VERSION_PREV=$unstable_version_prev" >> $GITHUB_ENV
4852
4953
- name: Update version
50-
run: .github/scripts/update-version.sh $STABLE_VERSION $UNSTABLE_VERSION
54+
run: .github/scripts/update-version-patch.sh $STABLE_VERSION $UNSTABLE_VERSION $STABLE_VERSION_PREV $UNSTABLE_VERSION_PREV
5155

5256
- name: Set up Python 3.9
5357
uses: actions/setup-python@v5

.github/workflows/release.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -118,36 +118,3 @@ jobs:
118118
# the step below is creating a pull request against main
119119
ref: main
120120

121-
- name: Copy change log updates to main
122-
env:
123-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124-
run: |
125-
echo "VERSION=${STABLE_VERSION}\/${UNSTABLE_VERSION}" >> $GITHUB_ENV
126-
echo "RELEASE_TAG=$STABLE_VERSION" >> $GITHUB_ENV
127-
./scripts/merge_changelog_to_main.sh
128-
129-
- name: Use CLA approved github bot
130-
run: .github/scripts/use-cla-approved-github-bot.sh
131-
132-
- name: Create pull request against main
133-
env:
134-
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
135-
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
136-
run: |
137-
message="Copy change log updates from $GITHUB_REF_NAME"
138-
body="Copy log updates from \`$GITHUB_REF_NAME\`."
139-
branch="opentelemetrybot/copy-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
140-
141-
if [[ -z $PRIOR_VERSION_WHEN_PATCH ]]; then
142-
if git diff --quiet; then
143-
echo there are no updates needed to the change log on main, not creating pull request
144-
exit 0 # success
145-
fi
146-
fi
147-
148-
git commit -a -m "$message"
149-
git push origin HEAD:$branch
150-
gh pr create --title "$message" \
151-
--body "$body" \
152-
--head $branch \
153-
--base main

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension-pkg-whitelist=cassandra
77

88
# Add list of files or directories to be excluded. They should be base names, not
99
# paths.
10-
ignore=CVS,gen,Dockerfile,docker-compose.yml,README.md,requirements.txt,docs
10+
ignore=CVS,gen,Dockerfile,docker-compose.yml,README.md,requirements.txt,docs,.venv
1111

1212
# Add files or directories matching the regex patterns to be excluded. The
1313
# regex matches against base names, not paths.

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- `opentelemetry-instrumentation-sqlalchemy` Update unit tests to run with SQLALchemy 2
1717
([#2976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2976))
18+
- Add `opentelemetry-instrumentation-openai-v2` to `opentelemetry-bootstrap`
19+
([#2996](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2996))
20+
- `opentelemetry-instrumentation-sqlalchemy` Add sqlcomment to `db.statement` attribute
21+
([#2937](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2937))
22+
- `opentelemetry-instrumentation-dbapi` Add sqlcomment to `db.statement` attribute
23+
([#2935](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2935))
24+
- `opentelemetry-instrumentation-dbapi` instrument_connection accepts optional connect_module
25+
([#3027](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3027))
26+
- `opentelemetry-instrumentation-mysqlclient` Add sqlcommenter support
27+
([#2941](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2941))
28+
- `opentelemetry-instrumentation-pymysql` Add sqlcommenter support
29+
([#2942](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2942))
1830

1931
### Fixed
2032

33+
- `opentelemetry-instrumentation-httpx`: instrument_client is a static method again
34+
([#3003](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3003))
35+
- `opentelemetry-instrumentation-system_metrics`: fix callbacks reading wrong config
36+
([#3025](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3025))
37+
- `opentelemetry-instrumentation-httpx`: Check if mount transport is none before wrap it
38+
([#3022](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3022))
39+
- Replace all instrumentor unit test `assertEqualSpanInstrumentationInfo` calls with `assertEqualSpanInstrumentationScope` calls
40+
([#3037](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3037))
41+
2142
### Breaking changes
2243

2344
- `opentelemetry-instrumentation-sqlalchemy` teach instruments version
2445
([#2971](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2971))
2546
- Drop `opentelemetry-instrumentation-test` package from default instrumentation list
2647
([#2969](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2969))
48+
- `opentelemetry-instrumentation-httpx`: remove private unused `_InstrumentedClient` and `_InstrumentedAsyncClient` classes
49+
([#3036](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3036))
2750

2851
## Version 1.28.0/0.49b0 (2024-11-05)
2952

RELEASING.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
(otherwise the workflow will pick up the version from `main` and just remove the `.dev` suffix).
1010
* Review the two pull requests that it creates.
1111
(one is targeted to the release branch and one is targeted to `main`).
12-
* Merge the one targeted towards the release branch.
13-
* 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.
12+
* The builds will fail for both the `main` and release 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` and release builds to pass.
13+
* Merge the release PR.
14+
* Merge the PR to main (this can be done separately from [making the release](#making-the-release))
1415

1516
### Preparing a major or minor release for individual package
1617

@@ -62,6 +63,7 @@ The workflow can only be run against long-term release branch such as `package-r
6263
* Review and merge the pull request that it creates for updating the change log in main
6364
(note that if this is not a patch release then the change log on main may already be up-to-date,
6465
in which case no pull request will be created).
66+
* Verify that a new [Github release](https://github.com/open-telemetry/opentelemetry-python-contrib/releases) has been created and that the CHANGELOGs look correct.
6567

6668
### Releasing individual package
6769

@@ -79,6 +81,14 @@ to pick a specific package to release.
7981

8082
The workflow can only be run against long-term release branch such as `package-release/{package-name}/v{major}.{minor}.x` or `package-release/{package-name}/v{major}.{minor}bx`.
8183

84+
## After the release
85+
86+
* Check PyPI
87+
* This should be handled automatically on release by the [publish action](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/release.yml).
88+
* Check the [action logs](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/release.yml) to make sure packages have been uploaded to PyPI
89+
* Check the release history (e.g. https://pypi.org/project/opentelemetry-instrumentation/#history) on PyPI
90+
* If for some reason the action failed, see [Publish failed](#publish-failed) below
91+
8292
## Notes about version numbering for stable components
8393

8494
* The version number for stable components in the `main` branch is always `X.Y.0.dev`,
@@ -110,28 +120,6 @@ The workflow can only be run against long-term release branch such as `package-r
110120
* The version number for unstable components in the `main` branch will be bumped to the next version,
111121
e.g. `0.{Y+1}b0.dev`.
112122

113-
## After the release
114-
115-
* Check PyPI
116-
* This should be handled automatically on release by the [publish action](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/release.yml).
117-
* Check the [action logs](https://github.com/open-telemetry/opentelemetry-python-contrib/actions/workflows/release.yml) to make sure packages have been uploaded to PyPI
118-
* Check the release history (e.g. https://pypi.org/project/opentelemetry-instrumentation/#history) on PyPI
119-
* If for some reason the action failed, see [Publish failed](#publish-failed) below
120-
* Move stable tag
121-
* Run the following (TODO automate):
122-
123-
```bash
124-
git tag -d stable
125-
git tag stable
126-
git push --delete origin tagname
127-
git push origin stable
128-
```
129-
130-
* This will ensure the docs are pointing at the stable release.
131-
* To validate this worked, ensure the stable build has run successfully:
132-
<https://readthedocs.org/projects/opentelemetry-python/builds/>.
133-
If the build has not run automatically, it can be manually trigger via the readthedocs interface.
134-
135123
## Releasing dev version of new packages to claim namespace
136124

137125
When a contribution introduces a new package, in order to mitigate name-squatting incidents, release the current development version of the new package under the `opentelemetry` user to simply claim the namespace. This should be done shortly after the PR that introduced this package has been merged into `main`.

instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Add example to `opentelemetry-instrumentation-openai-v2`
11+
([#3006](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3006))
12+
- Support for `AsyncOpenAI/AsyncCompletions` ([#2984](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2984))
13+
1014
## Version 2.0b0 (2024-11-08)
1115

1216
- Use generic `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable

instrumentation-genai/opentelemetry-instrumentation-openai-v2/README.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@ OpenTelemetry OpenAI Instrumentation
66
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-openai-v2.svg
77
:target: https://pypi.org/project/opentelemetry-instrumentation-openai-v2/
88

9-
Instrumentation with OpenAI that supports the OpenAI library and is
10-
specified to trace_integration using 'OpenAI'.
9+
This library allows tracing LLM requests and logging of messages made by the
10+
`OpenAI Python API library <https://pypi.org/project/openai/>`_.
1111

1212

1313
Installation
1414
------------
1515

16+
If your application is already instrumented with OpenTelemetry, add this
17+
package to your requirements.
1618
::
1719

1820
pip install opentelemetry-instrumentation-openai-v2
1921

22+
If you don't have an OpenAI application, yet, try our `example <example>`_
23+
which only needs a valid OpenAI API key.
2024

2125
References
2226
----------
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Update this with your real OpenAI API key
2+
OPENAI_API_KEY=sk-YOUR_API_KEY
3+
4+
# Uncomment to use Ollama instead of OpenAI
5+
# OPENAI_BASE_URL=http://localhost:11434/v1
6+
# OPENAI_API_KEY=unused
7+
# CHAT_MODEL=qwen2.5:0.5b
8+
9+
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
10+
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
11+
OTEL_SERVICE_NAME=opentelemetry-python-openai
12+
13+
# Change to 'false' to disable logging
14+
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
15+
# Change to 'console' if your OTLP endpoint doesn't support logs
16+
OTEL_LOGS_EXPORTER=otlp_proto_http
17+
# Change to 'false' to hide prompt and completion content
18+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true

0 commit comments

Comments
 (0)