mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 22:23:12 +08:00
Improve pymongo instrumentation example (#3315)
This commit is contained in:

committed by
GitHub

parent
6114b60506
commit
f98f5688ae
@ -57,12 +57,15 @@ for example:
|
||||
|
||||
def request_hook(span, event):
|
||||
# request hook logic
|
||||
pass
|
||||
|
||||
def response_hook(span, event):
|
||||
# response hook logic
|
||||
pass
|
||||
|
||||
def failed_hook(span, event):
|
||||
# failed hook logic
|
||||
pass
|
||||
|
||||
# Instrument pymongo with hooks
|
||||
PymongoInstrumentor().instrument(request_hook=request_hook, response_hook=response_hook, failed_hook=failed_hook)
|
||||
|
Reference in New Issue
Block a user