Skip to content

Commit

Permalink
Merge branch 'main' into pymysql-sqlcomment
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi authored Nov 6, 2024
2 parents dec459b + 77613da commit 2759bd2
Show file tree
Hide file tree
Showing 158 changed files with 2,239 additions and 1,935 deletions.
5 changes: 5 additions & 0 deletions .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ components:

processor/opentelemetry-processor-baggage:
- codeboten

instrumentation-genai/:
- karthikscale3
- lmolkova
- lzchen
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ jobs:
{%- if job_data == "generate-workflows" %}
if: |
!contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows')
&& github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
&& github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request'
{%- endif %}
{%- if job_data == "public-symbols-check" %}
if: |
!contains(github.event.pull_request.labels.*.name, 'Approve Public API check')
&& github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
{%- endif %}
{%- if job_data == "docs" %}
if: |
github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request'
{%- endif %}
steps:
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
docs:
name: docs
runs-on: ubuntu-latest
if: |
github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request'
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -96,7 +98,7 @@ jobs:
runs-on: ubuntu-latest
if: |
!contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows')
&& github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
&& github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request'
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/package-prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- opentelemetry-propagator-aws-xray
- opentelemetry-resource-detector-azure
- opentelemetry-sdk-extension-aws
- opentelemetry-instrumentation-openai-v2
description: 'Package to be released'
required: true
jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/package-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- opentelemetry-propagator-aws-xray
- opentelemetry-resource-detector-azure
- opentelemetry-sdk-extension-aws
- opentelemetry-instrumentation-openai-v2
description: 'Package to be released'
required: true

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- opentelemetry-propagator-aws-xray
- opentelemetry-resource-detector-azure
- opentelemetry-sdk-extension-aws
- opentelemetry-instrumentation-openai-v2
description: 'Package to be released'
required: true
jobs:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

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

### Added

- `opentelemetry-instrumentation-openai-v2` Instrumentation for OpenAI >= 0.27.0
Expand Down Expand Up @@ -40,6 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2940](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2940))
- `opentelemetry-instrumentation-dbapi` sqlcommenter key values created from PostgreSQL, MySQL systems
([#2897](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2897))
- `opentelemetry-instrumentation-system-metrics`: don't report open file descriptors on Windows
([#2946](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2946))

### Breaking changes

Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Please also read the [OpenTelemetry Contributor Guide](https://github.com/open-t
* [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)
* [Guidance for GenAI instrumentations](#guideline-for-genai-instrumentations)
* [Expectations from contributors](#expectations-from-contributors)

## Find a Buddy and get Started Quickly
Expand Down Expand Up @@ -272,6 +273,18 @@ Below is a checklist of things to be mindful of when implementing a new instrume
- ex. <https://github.com/open-telemetry/opentelemetry-python-contrib/blob/60fb936b7e5371b3e5587074906c49fb873cbd76/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py#L84>
- All instrumentations have the same version. If you are going to develop a new instrumentation it would probably have `X.Y.dev` version and depends on `opentelemetry-instrumentation` and `opentelemetry-semantic-conventions` for the same version. That means that if you want to install your instrumentation you need to install its dependencies from this repo and the core repo also from git.

## Guidance for GenAI instrumentations

Instrumentations that relate to [Generative AI](https://opentelemetry.io/docs/specs/semconv/gen-ai/) systems will be placed in the [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.

### Get Involved

* Reviewing PRs: If you would like to be tagged as reviewer in new PRs related to these instrumentations, please submit a PR to add your GitHub handle to [component_owners.yml](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2944/.github/component_owners.yml) under the corresponding instrumentation folder(s).

* Approving PRs: If you would like to be able to approve PRs related to these instrumentations, you must join [opentelemetry-python-contrib-approvers](https://github.com/orgs/open-telemetry/teams/opentelemetry-python-contrib-approvers) team. Please ask one of the [Python contrib maintainers](https://github.com/orgs/open-telemetry/teams/opentelemetry-python-contrib-maintainers) to be accepted into the team.

* Tracking and Creating Issues: For tracking issues related to Generative AI, please filter or add the label [gen-ai](https://github.com/open-telemetry/opentelemetry-python-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Agen-ai) when creating or searching issues. If you do not see an issue related to an instrumentation you would like to contribute to, please create a new tracking issue so the community is aware of its progress.

## 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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ Emeritus Approvers:
Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-telemetry/teams/python-maintainers)):

- [Aaron Abbott](https://github.com/aabmass), Google
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
- [Leighton Chen](https://github.com/lzchen), Microsoft
- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic
- [Shalev Roda](https://github.com/shalevr), Cisco

Emeritus Maintainers:

- [Alex Boten](https://github.com/codeboten), Lightstep
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
- [Owais Lone](https://github.com/owais), Splunk
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google

Expand Down
3 changes: 2 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
> - opentelemetry-propagator-aws-xray
> - opentelemetry-resource-detector-azure
> - opentelemetry-sdk-extension-aws
>
> - opentelemetry-instrumentation-openai-v2
> These libraries are also excluded from the general release.
Package release preparation is handled by the [`[Package] Prepare release`](./.github/workflows/package-prepare-release.yml) workflow that allows
Expand Down Expand Up @@ -70,6 +70,7 @@ The workflow can only be run against long-term release branch such as `package-r
> - opentelemetry-propagator-aws-xray
> - opentelemetry-resource-detector-azure
> - opentelemetry-sdk-extension-aws
> - opentelemetry-instrumentation-openai-v2
>
> These libraries are also excluded from the general 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.49b0.dev"
__version__ = "0.50b0.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.28.0.dev
version=1.29.0.dev

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

[prerelease]
version=0.49b0.dev
version=0.50b0.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.49b0.dev"
__version__ = "0.50b0.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.49b0.dev",
"opentelemetry-semantic-conventions == 0.50b0.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.49b0.dev"
__version__ = "0.50b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## Version 2.0b0 (2024-11-05)

- Use generic `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable
to control if content of prompt, completion, and other messages is captured.
([#2947](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2947))

- Update OpenAI instrumentation to Semantic Conventions v1.28.0: add new attributes
and switch prompts and completions to log-based events.
([#2925](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2925))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
server_attributes as ServerAttributes,
)

OTEL_INSTRUMENTATION_OPENAI_CAPTURE_MESSAGE_CONTENT = (
"OTEL_INSTRUMENTATION_OPENAI_CAPTURE_MESSAGE_CONTENT"
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT = (
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT"
)


def is_content_enabled() -> bool:
capture_content = environ.get(
OTEL_INSTRUMENTATION_OPENAI_CAPTURE_MESSAGE_CONTENT, "false"
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, "false"
)

return capture_content.lower() == "true"
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__ = "2.0.0.dev"
__version__ = "2.1b0.dev"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pytest-vcr==1.0.2
wrapt==1.16.0

-e opentelemetry-instrumentation
-e instrumentation/opentelemetry-instrumentation-openai-v2
-e instrumentation-genai/opentelemetry-instrumentation-openai-v2
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
interactions:
- request:
body: '{"messages": [{"role": "user", "content": "Say this is a test"}], "model":
"this-model-does-not-exist"}'
body: |-
{
"messages": [
{
"role": "user",
"content": "Say this is a test"
}
],
"model": "this-model-does-not-exist"
}
headers:
accept:
- application/json
Expand All @@ -16,41 +24,45 @@ interactions:
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.52.2
- OpenAI/Python 1.26.0
x-stainless-arch:
- other:amd64
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Windows
- MacOS
x-stainless-package-version:
- 1.52.2
x-stainless-retry-count:
- '2'
- 1.26.0
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.7
- 3.12.6
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: "{\n \"error\": {\n \"message\": \"The model `this-model-does-not-exist`
does not exist or you do not have access to it.\",\n \"type\": \"invalid_request_error\",\n
\ \"param\": null,\n \"code\": \"model_not_found\"\n }\n}\n"
string: |-
{
"error": {
"message": "The model `this-model-does-not-exist` does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8d88b04c2c5db9eb-SEA
- 8dd0709dffd19c8c-SIN
Connection:
- keep-alive
Content-Type:
- application/json; charset=utf-8
Date:
- Sat, 26 Oct 2024 07:21:17 GMT
- Mon, 04 Nov 2024 00:20:44 GMT
Server:
- cloudflare
Set-Cookie: test_set_cookie
Expand All @@ -68,7 +80,7 @@ interactions:
vary:
- Origin
x-request-id:
- req_8529656422f0360e8bcba8c2b8fe34e9
- req_e08854c4f7d5104af6fdc755caed30fc
status:
code: 404
message: Not Found
Expand Down
Loading

0 comments on commit 2759bd2

Please sign in to comment.