Skip to content

Commit

Permalink
Merge branch 'main' into lambda-span-link
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored Feb 20, 2023
2 parents 6578045 + d5cbd67 commit 1cd9ed9
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
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
confluent-kafka>= 1.8.2,< 2.0.0
elasticsearch>=2.0,<9.0
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def getlistcfg(strval):
]


ignore_categories = ["py-class", "py-func", "py-exc", "any"]
ignore_categories = ["py-class", "py-func", "py-exc", "py-obj", "any"]

for category in ignore_categories:
if category in mcfg:
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:
12 changes: 11 additions & 1 deletion docs/nitpick-exceptions.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ py-class=
opentelemetry.sdk.trace.id_generator.IdGenerator
opentelemetry.instrumentation.confluent_kafka.ProxiedProducer
opentelemetry.instrumentation.confluent_kafka.ProxiedConsumer
opentelemetry.instrumentation.instrumentor.BaseInstrumentor
; - AwsXRayIdGenerator
TextMapPropagator
CarrierT
Expand Down Expand Up @@ -54,7 +55,16 @@ any=
; - instrumentation.*
Setter
httpx
;
instrument
__iter__
list.__iter__
__getitem__
list.__getitem__
SQS.ReceiveMessage

py-obj=
opentelemetry.propagators.textmap.CarrierT

py-func=
poll
flush
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
.. _boto3sqs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs.html
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
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,26 @@ def response_hook(span, response):
spans[0].attributes[response_attribute_name],
)

def test_no_op_tracer_provider(self, request_mock):
ElasticsearchInstrumentor().uninstrument()
ElasticsearchInstrumentor().instrument(
tracer_provider=trace.NoOpTracerProvider()
)
response_payload = '{"found": false, "timed_out": true, "took": 7}'
request_mock.return_value = (
1,
{},
response_payload,
)
es = Elasticsearch()
res = es.get(index="test-index", doc_type="_doc", id=1)
self.assertEqual(
res.get("found"), json.loads(response_payload).get("found")
)

spans_list = self.get_finished_spans()
self.assertEqual(len(spans_list), 0)

def test_body_sanitization(self, _):
self.assertEqual(
sanitize_body(sanitization_queries.interval_query),
Expand Down

0 comments on commit 1cd9ed9

Please sign in to comment.