OpenAI instrumentation docs fixes (#2988)

* Add openai docs config and improve readme

* up

* Add manual sample, add no-content tests

* update headers

* lint

* use grpc endpoint in openai samples, add extra env vars to readme

* move distro fix to another PR

* nits

* Ignore examples for pylint

* Update .pylintrc

* ignroe lint for example

* Fix README docs

* Update openai.rst

* Update conf.py

* Update docs-requirements.txt

* docs

---------

Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
This commit is contained in:
Liudmila Molkova
2024-12-02 01:23:11 -08:00
committed by GitHub
parent 8656a06f88
commit 142b86c1bf
21 changed files with 555 additions and 14 deletions

View File

@ -40,6 +40,13 @@ instr_dirs = [
if isdir(join(instr, f))
]
instr_genai = "../instrumentation-genai"
instr_genai_dirs = [
os.path.abspath("/".join(["../instrumentation-genai", f, "src"]))
for f in listdir(instr_genai)
if isdir(join(instr_genai, f))
]
prop = "../propagator"
prop_dirs = [
os.path.abspath("/".join([prop, f, "src"]))
@ -60,7 +67,14 @@ resource_dirs = [
for f in listdir(resource)
if isdir(join(resource, f))
]
sys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs + prop_dirs + resource_dirs
sys.path[:0] = (
exp_dirs
+ instr_dirs
+ instr_genai_dirs
+ sdk_ext_dirs
+ prop_dirs
+ resource_dirs
)
# -- Project information -----------------------------------------------------

View File

@ -24,7 +24,7 @@ installed separately via pip:
pip install opentelemetry-instrumentation-{instrumentation}
pip install opentelemetry-sdk-extension-{sdk-extension}
A complete list of packages can be found at the
A complete list of packages can be found at the
`Contrib repo instrumentation <https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation>`_
and `Contrib repo exporter <https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter>`_ directories.
@ -50,6 +50,7 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>
cd opentelemetry-python-contrib
pip install -e ./instrumentation/opentelemetry-instrumentation-flask
pip install -e ./instrumentation/opentelemetry-instrumentation-botocore
pip install -e ./instrumentation-genai/opentelemetry-instrumentation-openai-v2
pip install -e ./sdk-extension/opentelemetry-sdk-extension-aws
pip install -e ./resource/opentelemetry-resource-detector-container
@ -62,6 +63,14 @@ install <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>
instrumentation/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Generative AI Instrumentations
:name: Generative AI Instrumentations
:glob:
instrumentation-genai/**
.. toctree::
:maxdepth: 2
:caption: OpenTelemetry Propagators

View File

@ -0,0 +1,7 @@
OpenTelemetry Python - OpenAI Instrumentation
=============================================
.. automodule:: opentelemetry.instrumentation.openai_v2
:members:
:undoc-members:
:show-inheritance:

View File

@ -24,6 +24,7 @@ py-class=
httpx.Client
httpx.AsyncClient
httpx.BaseTransport
openai.BaseTransport
httpx.AsyncBaseTransport
httpx.SyncByteStream
httpx.AsyncByteStream