Skip to content

Commit

Permalink
remove docs from README.rst, including them only in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayGibel-helios committed Oct 24, 2021
1 parent b8e666b commit 1bd4ed4
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions instrumentation/opentelemetry-instrumentation-pika/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ Usage
.. code-block:: python
PikaInstrumentor.instrument_channel(channel, tracer_provider=tracer_provider)
* PikaInstrumentor also supports instrumenting with hooks that will be called when producing or consuming a message.
The hooks should be of type `Callable[[Span, bytes, BasicProperties], None]`
where the first parameter is the span, the second parameter is the message body
and the third parameter is the message properties

.. code-block:: python
def publish_hook(span: Span, body: bytes, properties: BasicProperties):
span.set_attribute("messaging.payload", body.decode())
def consume_hook(span: Span, body: bytes, properties: BasicProperties):
span.set_attribute("messaging.id", properties.message_id)
PikaInstrumentor.instrument_channel(channel, publish_hook=publish_hook, consume_hook=consume_hook)
References
----------

Expand Down

0 comments on commit 1bd4ed4

Please sign in to comment.