Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add boto3sqs to docs #1666

Merged
merged 14 commits into from
Feb 20, 2023
1 change: 1 addition & 0 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ aiopg>=0.13.0,<1.3.0
asyncpg>=0.12.0
boto~=2.0
botocore~=1.0
boto3~=1.0
celery>=4.0
elasticsearch>=2.0,<9.0
flask~=2.0
Expand Down
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ def getlistcfg(strval):
)
)

if "obj" in mcfg:
objs = getlistcfg(mcfg["obj"])
for _obj in objs:
nitpick_ignore.append(
(
"py:obj",
_obj,
)
)

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
6 changes: 6 additions & 0 deletions docs/instrumentation/boto3sqs/boto3sqs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. include:: ../../../instrumentation/opentelemetry-instrumentation-boto3sqs/README.rst

.. automodule:: opentelemetry.instrumentation.boto3sqs
:members:
:undoc-members:
:show-inheritance:
3 changes: 3 additions & 0 deletions docs/nitpick-exceptions.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ anys=
; - instrumentation.*
Setter
httpx

obj=
opentelemetry.propagators.textmap.CarrierT
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Instrument `boto3sqs`_ to trace SQS applications.
Instrument boto3sqs to trace SQS applications.

.. _boto3sqs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this remove the hyperlink?



Usage
-----

.. code:: python
.. code-block:: python

import boto3
from opentelemetry.instrumentation.boto3sqs import Boto3SQSInstrumentor


Boto3SQSInstrumentor().instrument()

---
"""
import logging
from typing import Any, Collection, Dict, Generator, List, Mapping, Optional
Expand Down Expand Up @@ -102,9 +102,9 @@ class ContextableList(list):
"""
Since the classic way to process SQS messages is using a `for` loop, without a well defined scope like a
callback - we are doing something similar to the instrumentaiton of Kafka-python and instrumenting the
`__iter__` functions and the `__getitem__` functions to set the span context of the addressed message. Since
the return value from an `SQS.ReceiveMessage` returns a builtin list, we cannot wrap it and change all of the
calls for `list.__iter__` and `list.__getitem__` - therefore we use ContextableList. It is bound to the
'__iter__' functions and the '__getitem__' functions to set the span context of the addressed message. Since
the return value from an 'SQS.ReceiveMessage' returns a builtin list, we cannot wrap it and change all of the
calls for 'list.__iter__' and 'list.__getitem__' - therefore we use ContextableList. It is bound to the
received_messages_spans dict
"""

Expand Down