Commit Graph

284 Commits

Author SHA1 Message Date
Riccardo Magliocchetti 6c57132bbb
Add rstcheck in pre-commit (#3777)
* Fix a bunch of rstcheck warnings

* Add rstcheck to pre-commit

* Ignore automodule

* Update changelog and contributing

* tox -e ruff -> tox -e precommit

But keep the old name for compat
2025-09-25 07:41:25 +00:00
Aaron Abbott 6ae5e34ace
Fix package release workflows version.py finding (#3782)
Looking at the files in this repo, the version file is always called version.py (and it should be). Tested the find command locally.

```shell
$ for f in $(git ls-files '*version*.py'); do basename $f; done | sort -u
test_version.py
version.py

$ find util/opentelemetry-util-genai/ -type f -path "**/version.py"
util/opentelemetry-util-genai/src/opentelemetry/util/genai/version.py
```
2025-09-24 17:03:01 -04:00
Aaron Abbott b2ed70ff86
Add opentelemetry-util-genai to the package release workflow (#3781) 2025-09-24 16:17:17 -04:00
wrisa 60a670f093
Added span support for genAI langchain llm invocation (#3665)
* Added span support for llm invocation

* removed invalid code

* added entry point and fixed unwrap

* fixed check runs and updated dependencies

* fixed ruff error

* moved span generation code and added test coverage

* ruff formatting

* ruff formatting again

* removed config exception logger

* removed dontThrow

* fixed span name

* fixed ruff

* fixed typecheck

* added span exist check

* fixed typecheck

* removed start time from span state and moved error handler method to span manager

* fixed ruff

* made SpanManager class and method private

* removed deprecated gen_ai.system attribute

* Moved model to fixture and changed imports

* Fixed ruff errors and renamed method

* Added bedrock support and test

* Fixed ruff errors

* Addressed Aaron's comments

* Reverted versions and ignored typecheck errors

* removed context and added issue

* fixed versions

* skipped telemetry for other than ChatOpenAI and ChatBedrock. Added test for the same.

* Fixed telemetry skipping logic

* Fixed ruff

* added notice file

* fixed conflict

* fixed ruff and typecheck

* fixed ruff

* upgraded semcov version

---------

Co-authored-by: Aaron Abbott <aaronabbott@google.com>
2025-09-19 21:19:40 +00:00
Riccardo Magliocchetti 7bac6bedef
Revise component owners (#3757)
* Revise codeowners

Drop from codeowners people that have not partecipated in the last year

While at it sort the entries.

* Add entry for util/opentelemetry-util-genai
2025-09-17 14:16:34 +00:00
Emídio Neto 487f901c54
infra: ignore pushes on otelbot branches (#3744)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-09-11 07:04:30 +00:00
OpenTelemetry Bot 51da0a766e
Add subscript to issue templates (#3669)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-08-28 11:09:34 +00:00
Jonathan Lee 032d6c67be
AWS X-Ray Remote Sampler Part 1 - Initial Classes and Rules Poller Implementation (#3366)
* remote sampling - initial classes and rules poller

* run generate-workflows and ruff

* add component owner for aws sampler, run lint

* move sampler into aws sdk-extensions

* move sampler tests to trace dir, update otel api/sdk deps, update changelog

* move mock_clock into tests dir

* update component owners for sdk-extension-aws

* ruff and lint

* address comments

* make sampler implementation internal until completion, update tests to not make http requests

* remove use of Optional, restore README of the package

* remove unused clock and client_id

* Update component_owners.yml

* Update CHANGELOG.md

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-08-25 14:57:48 +02:00
Keith Decker bbcdf8b737
GenAI Utils Structure (#3672)
* GenAI SDK Structure

* generate bootstrap entry

* Rename GenAI SDK to GenAI Utils

* remove duplicate dependency

* update uv lock

* generate tox doc

* remove sdk dependency, remove bootstrap entry

* ran tox generate and uv sync

* move package out of instrumentation folder

* remove package file

* rename package to align with other util package

* add tox boilerplate

* tox boilerplate

* Fix pytest version

* Corrected RST Link
2025-08-14 22:33:26 -04:00
Joe McGinley a39c6c166d
Fix git pull error in core contrib test (#3357)
* Fix git pull error in core contrib test

Core contrib is intermittently failing when
pulling the core repo because tox does not
retry on failure.

Add gh actions/checkout for the core repo
before running tox to mitigate this.

* generate-workflows

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* Update CHANGELOG.md

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
2025-07-28 16:23:13 +02:00
OpenTelemetry Bot bca482609b
Add minimum token permissions for all github workflow files (#3604) 2025-07-24 07:33:31 -08:00
OpenTelemetry Bot c30b8fa9a5
Migrate from opentelemetrybot to otelbot (#3641) 2025-07-23 09:02:44 -08:00
Emídio Neto 4a21b3974b
resource-dector-container: package rename to `opentelemetry-resource-detector-containerid` (#3536)
* resource-dector-container: package rename

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix ruff

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* change entrypoint

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix test

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix for entrypoint name

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add changelog

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-06-04 10:41:38 +02:00
Joe McGinley a164d37a3c
Chore: Drop support for Python 3.8 (#3399)
Python 3.8 was EoL @ 2024-10-07, our 6 month promise for support ended on 2024-04-07.

Changes:
* Updated basline refs to 3.9
* Removed 3.8 sys.version_info checks
* Fixed botocore test failure
* Applied ruff formatting
2025-05-27 17:26:02 +02:00
Emídio Neto 8a83770d7b
fix sha-automation (#3445)
* fix sha-automation

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* use default github_token instead

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-04-28 15:55:03 +02:00
Emídio Neto 7f347e54df
infra: Automate SHA procedure during releases (#3424) 2025-04-24 09:31:08 -08:00
Emídio Neto 3431a4e8b0
Update core_contrib_test_0.yml (#3431)
* Update core_contrib_test_0.yml

* Update core_contrib_test.yml.j2
2025-04-17 14:04:38 -04:00
Emídio Neto 8390db35ae
infra(ci): configure concurrency to cancel stale runs and setting timeouts (#3422)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-04-17 08:07:46 +00:00
OpenTelemetry Bot 78373353f5
Add ossf-scorecard scanning workflow (#3398)
* Add ossf-scorecard scanning workflow

* Add end of file newline

---------

Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-04-02 09:28:12 +00:00
Joe McGinley 0ea9998c4c
Add asyncclick instrumentation (#3319)
* Add asyncclick instrumentation

* Add instrumentation for asyncclick based CLI apps
* Add tox
* Add Changelog
* Update workflows

This implementation is based on the original click instrumentation work by:
- Emídio Neto <9735060+emdneto@users.noreply.github.com>
- Anuraag (Rag) Agrawal <anuraaga@gmail.com>
- Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Fix async refs in code-block example

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2025-03-28 12:20:29 +01:00
Leighton Chen f96d14cc62
update (#3363) 2025-03-13 09:35:08 +01:00
OpenTelemetry Bot 6189be647c
Update version to 1.32.0.dev/0.53b0.dev (#3359) 2025-03-12 12:07:49 -08:00
Aaron Abbott 9e4de00420
Small fixes for google-genai before releasing (#3330) 2025-03-05 10:40:00 -05:00
Aaron Abbott c6c0162cef
Loosen `opentelemetry-instrumentation-starlette[instruments]` specifier (#3304)
* Loosen `opentelemetry-instrumentation-starlette[instruments]` specifier

* Compile locked requirements with uv

* Update comment for clarity

* Generate for python 3.8+

* Update package.py as well

* generate

* Oops, undo accidental change to starlette version

* Update uv pip compile command to remove core repo git SHAs and absolute paths
2025-03-03 20:22:57 +00:00
Michael Safyan c09a299010
Initial version of instrumentation for the Google GenAI SDK (github.com/googleapis/python-genai) (#3256)
* Begin instrumentation of GenAI SDK.

* Snapshot current state.

* Created minimal tests and got first test to pass.

* Added test for span attributes.

* Ensure that token counts work.

* Add more tests.

* Make it easy to turn off instrumentation for streaming and async to allow for rapid iteration.

* Add licenses and fill out main README.rst.

* Add a changelog file.

* Fill out 'requirements.txt' and 'README.rst' for the manual instrumentation example.

* Add missing exporter dependency for the manual instrumentation example.

* Fill out rest of the zero-code example.

* Add minimal tests for async, streaming cases.

* Update sync test to use indirection on top of 'client.models.generate_content' to simplify test reuse.

* Fix ruff check issues.

* Add subproject to top-level project build mechanism.

* Simplify invocation of pylint.

* Fix 'make test' command and lint issues.

* Add '.dev' suffix to version per feedback on pull request #3256

* Fix README.rst files for the examples.

* Add specific versions for the examples.

* Revamp 'make test' to not require local 'tox.ini' configuration.

* Extend separators per review comment.

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>

* Fix version conflict caused by non-hermetic requirements.

* Fix typo on the comment line.

* Add test for the use of the 'vertex_ai' system, and improve how this system is determined.

* Factor out testing logic to enable sharing with the async code.

* Addressed minor lint issues.

* Make it clearer that nonstreaming_base is a helper module that is not invoked directly.

* Integrate feedback from related pull request #3268.

* Update workflows with 'tox -e generate-workflows'.

* Improve data model and add some rudimentary type checking.

* Accept only 'true' for a true value to align with other code.

* Update the scope name used.

* Add **kwargs to patched methods to prevent future breakage due to the addition of future keyword arguments.

* Remove redundant list conversion in call to "sorted".

Co-authored-by: Aaron Abbott <aaronabbott@google.com>

* Reformat with 'tox -e ruff'.

* Fix failing lint workflow.

* Fix failing lint workflow.

* Exclude Google GenAI instrumentation from the bootstrap code for now.

* Minor improvements to the tooling shell files.

* Fix typo flagged by codespell spellchecker.

* Increase alignment with broader repo practices.

* Add more TODOs and documentation to clarify the intended work scope.

* Remove unneeded accessor from OTelWrapper.

* Add more comments to the tests.

* Reformat with ruff.

* Change 'desireable' to 'desirable' per codespell spellchecker.

* Make tests pass without pythonpath

* Fix new lint errors showing up after change

* Revert "Fix new lint errors showing up after change"

This reverts commit 567adc62a7.

pylint ignore instead

* Add TODO item required/requested from code review.

Co-authored-by: Aaron Abbott <aaronabbott@google.com>

* Simplify changelog per PR feedback.

* Remove square brackets from model name in span name per PR feedback.

* Misc test cleanup. Now that scripts are invoked solely through pytest via tox, remove main functions and hash bang lines.

* Improve quality of event logging.

* Update operation name to use a constant for consistency.

* Reformat with ruff.

* Exclude opentelemetry-instrumentation-google-genai from root uv workspace

Until https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3300 is fixed.

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
2025-02-27 11:37:40 -05:00
Aaron Abbott dc01beda66
Add `run-name` with package name to single-package release workflows (#3287) 2025-02-24 15:48:36 +00:00
Aaron Abbott f8bb30ef67
Updating workflows and RELEASING.md to allow vertexai individual release (#3284) 2025-02-21 17:12:14 -03:00
OpenTelemetry Bot 52bbcd6001
Add FOSSA scanning workflow (#3270)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
2025-02-20 10:21:51 +01:00
Michael Safyan 0cb9ba55e8
[chore] Replace '-0' and '-1' with semantically meaningful suffixes. Other minor fixes in 'instrumentation-genai' test structure. (#3268)
* Replace '-0' and '-1' with semantically meaningful suffixes.

* Act on feedback in PR 3268.

* Fix typos.
2025-02-19 16:25:07 +01:00
Emídio Neto 9d8a6c6420
infra: fix workflows (#3240) 2025-02-04 13:24:34 -08:00
OpenTelemetry Bot 85e21a9e22
Update version to 1.31.0.dev/0.52b0.dev (#3233) 2025-02-04 12:55:11 -08:00
guillaumep 5478a0b77a
Add pymssql instrumentation (#394)
* Add pymssql instrumentation

* Run tox -e generate

* tox -e generate-workflows

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-01-27 16:12:21 +01:00
Josh Owen 3f50c08580
psycopg2-binary support (#3186)
* psycopg2-binary support

* changelog

* Update CHANGELOG.md

* Update pyproject.toml

* fix

* lint

* added test config

* Update bootstrap_gen.py

* update tox

* Update tox.ini

* regenerate workflows

* workflows

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2025-01-21 15:41:56 -05:00
Riccardo Magliocchetti 9460773e5c
Basic instrumentation for Bedrock runtime Converse api (#3161)
* botocore: add extension for bedrock runtime api

* Add tests and handle only non streaming responses

* Make it explicit we are handling only the converse operation

* Simplify test since all models behaves the same

* Add test for error case and rework things a bit

* Add converse example

* Generate workflows

* Add changelog
2025-01-20 09:56:09 +01:00
Emídio Neto 9b217bb4ff
introducing tox-uv for real (#3185)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2025-01-17 17:33:52 +01:00
Josh Soref c59b514cda
Fix component owner workflow permissions (#3165) 2025-01-13 15:42:32 -08:00
Marcelo Trylesinski 406707b2bd
Add type checker (#3116) 2025-01-13 09:20:33 -08:00
Emídio Neto 54882871b9
add official support to Python 3.13 (#3134)
* add py313 to tox

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix wrong identation troveclassifiers

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix pyramid, django

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix httpx

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix httpx, grpc and add vertex

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* generate-workflows

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix generate-workflows

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix celery and psycopg

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* add changelog

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* Update CHANGELOG.md

* Update tox.ini

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-12-31 16:08:20 +00:00
YR Chen 2176e3e43e
opentelemetry-instrumentation-falcon: expand supported version to v4 (#3086)
* opentelemetry-instrumentation-falcon: expand supported version to v4

Falcon v4 has a mostly identical interface to v3, and is proved to be fully compatible with `opentelemetry-instrumentation-falcon`. Loose the version check to `<5.0.0` to avoid false `DependencyConflict` alarm.

* opentelemetry-instrumentation-falcon: generate tests for v4

* opentelemetry-instrumentation-falcon: prepare tests for v4

* opentelemetry-instrumentation-falcon: add test preset for `~=3.1.2`

* docs: add changelog for Falcon v4 instrumentation

* opentelemetry-instrumentation-falcon: adjust pylint mark for v4

* _has_fixed_http_target property

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* move changelog to the correct section

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix test and bootstrap_gen

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-12-23 17:34:48 +00:00
Aaron Abbott 72576f65e0
Vertex AI instrumentation boilerplate (#3123)
* Vertex AI boilerplate copied from openai-v2

* tox.ini boilerplate

* tox -e generate,generate-workflows
2024-12-21 23:45:53 +00:00
Emídio Neto 8656a06f88
try update misc workflows to py311 (#3055)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-28 17:07:52 +00:00
Riccardo Magliocchetti d330ab3dd0
Add click instrumentation (#2994)
* Add instrumentation for click based CLI apps

Co-authored-by: Anuraag (Rag) Agrawal <anuraaga@gmail.com>

* Add tox

* Add Changelog

* Silence pylint

* Update tox.ini

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update instrumentation/opentelemetry-instrumentation-click/pyproject.toml

* Add baseline version

* Adhere to new cli span semconv

* Update workflows

---------

Co-authored-by: Anuraag (Rag) Agrawal <anuraaga@gmail.com>
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
2024-11-27 08:38:38 +00:00
Emídio Neto 97d1514b65
fix missing contrib_repo_sha in workflow (#3049)
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
2024-11-26 15:03:42 +01:00
Emídio Neto 41bd34f6e1
infra: configure generate-workflows to generate core-contrib-tests (#3035)
* test call workflow

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

* fix name

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>

---------

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2024-11-26 12:16:45 +00:00
Aaron Abbott 23f67eb77b
Cherry pick eachdist.py changes to main from release/v1.28.x-0.49bx branch (#3018)
* Fix prepare patch release workflow (#3013)

* Fix eachdist.py patch release to respect "all" and "excluded" (#3016)
2024-11-18 12:29:35 -05:00
Leighton Chen c32cc7a3e2
Remove updating CHANGELOG step in release workflow (#3000) 2024-11-14 09:52:32 -08:00
Ali Waleed a6e4a0ca43
Add Support for `Async` openai instrumentation (#2984) 2024-11-14 08:53:27 -08:00
Leighton Chen c28f7c978e
re-add testpypi publish step (#2991) 2024-11-12 09:18:09 -08:00
Liudmila Molkova b6a6f75834
publish to pypi (#2980) (#2987) 2024-11-11 11:02:20 -08:00
Adrian Cole bf8e2814ea
opentelemetry-instrumentation-openai-v2: add codefromthecrypt and fix yaml fixture (#2989) 2024-11-11 08:12:26 -08:00