* opentelemetry-instrumentation-pymongo: fix rendering of API docs
While at it make the list of instrumentor parameters readable.
* opentelemetry-instrumentation-pymssql: fix rendering of API docs
* Update __init__.py
* botocore: document threading instrumentation for S3 multipart operations
Document that users need to enable ThreadingInstrumentor alongside
BotocoreInstrumentor for proper trace context propagation with S3
upload_file and download_file methods.
* botocore: move thread context docs to module docstring only
README.rst is not built into the documentation, so keep the
threading context propagation docs only in __init__.py where
autodoc will pick them up.
* Update __init__.py
* Update __init__.py
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
* add metrics to genai utils
* add Instruments class for GenAI metrics and refactor metric recording
* refactor: streamline metric payload handling in InvocationMetricsRecorder
* fix: grammar
* doc: added changelog
* fix: update version for semconvs
* Lint fixes
* Fix Nits, remove overly defensive code
* Add monotonic timing support for LLM invocation duration calculations
* small cleanups to types to simplify code
* cleanup test
* Simplify histogram duration time calculations
* Remove unused constants and helper function
* Refactor histogram creation to use standalone functions instead of a class
---------
Co-authored-by: aaronabbott <aaronabbott@google.com>
* opentelemetry-instrumentation: add support to skip all the available instrumentations
Introduce support for skipping all the available instrumentation with a wildcard *.
e.g. OTEL_PYTHON_DISABLED_INSTRUMENTATIONS="*"
* Add changelog
* fix: remove attributes where the value is NOT_GIVEN in openai-v2 instrumentation for chat.completions.create operations
* Generalize check for instances of NotGiven
* Test embeddings for NotGiven values
* Bump tested openai version to latest
* Add a test README for giving hints on recording tests cassettes
* Fix lint
* Fix CI for oldest
* Add missing type
* Stick to older jiter for PyPy
* Move test README in tests
* Add response_service_tier to test assertion
---------
Co-authored-by: bkawecki <bkbkawecki@gmail.com>
* fix: Fix service tier attribute names in openai-v2 instrumentation
* polish: extracting service_tier from extra_body.
* Extract service_tier from extra_body when not in kwargs
In OpenAI SDK 1.26.0, service_tier is passed via extra_body.
Update get_llm_request_attributes to check both kwargs and extra_body
for service_tier to support both ways of passing it.
* Add changelog entry for service tier attribute fix
Fix#3920: Add changelog entry documenting the fix for service tier
attribute names.
* wip: adding checks for service_tier.
* wip: fix linting errors.
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
* Rename InMemoryLogExporter to InMemoryLogRecordExporter
* Remove added file
* Update
* Remove alias
* Update
* Added backward compatibility in imports
* Lint
* Lint
* Lint for real this time :)
* opentelemetry-instrumentation-redis: implement suppression of instrumentation in Redis commands and pipelines
- Added `suppress_instrumentation` context manager to allow selective disabling of instrumentation for Redis commands and pipelines.
- Updated the Redis instrumentation to check if instrumentation is enabled before executing commands.
- Added unit tests to verify the functionality of the suppression feature for both synchronous and asynchronous Redis operations.
* Doc
* Ruff
* Disable too-many-public-methods for tests file
* Update instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py
---------
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
* use the errmsg as the status description instead of the _DocumentOut
* fix the unit tests (in particular the test was mocking event.failure as a str, when that's not what the type is)
* reformat, fix tests
* add changelog
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
The generate_instrumentation_bootstrap.py script was failing with a
ruff linting error (PLC0415: import should be at top-level) when
checking the auto_instrumentation module.
Add noqa comment to suppress this error for the gevent monkey patch
import, which is intentionally inside a try-except block for
conditional loading. This allows the bootstrap generation script
to complete successfully.
* Fix a few bugs in gen AI instrumentation
* Make a lot of changes
* Remove print statements
* fix lint issues
* remove added folder
* Address comments
* Move code into helper
* Revert change to pyright include
* Collect request attributes once
* Doen't add request attributes to span if it is not recording
While at it also avoid copying empty dictionaries
* Add support for collecting custom request and response headers
* update type annotations
* Add changelog
* Add PR number in changelog
* Add documentation
* Apply suggestions from code review
Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
---------
Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
* tornado: cite the instrumentation also handles OTEL_PYTHON_EXCLUDED_URLS
* aiohttp-server: document OTEL_PYTHON_EXCLUDED_URLS configuration
* Add test for aiohttp-server
And make the implementation testable
* Assert metrics in aiohttp-server tests
* Please pylint
* Initialize tracer, meter and excluded urls at instrument time
So they are testable
* Add changelog
* Update instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py