-
Notifications
You must be signed in to change notification settings - Fork 810
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
- Linux (python:3.11.4-debian-11-r39 docker image)
- Python 3.11.4
- opentelemetry-api 1.18.0
- opentelemetry-instrumentation 0.39b0
- opentelemetry-instrumentation-pymongo 0.39b0
- pymongo 4.3.3
Steps to reproduce
After setting up a PymongoInstrumentor, running any kind of Mongo command not included in this mapping; an aggregation for example.
import pymongo
from opentelemetry.instrumentation.pymongo import PymongoInstrumentor
PymongoInstrumentor().instrument(capture_statement=True)
client = pymongo.MongoClient(connection_params)
db = client["dbname"]
agg_query = db.mycollection.aggregate(
[
{"$match": {"condition": "value"}},
{"$group": {"_id": "$key", "count": {"$sum": 1}}},
]
)
output = list(agg_query)What is the expected behavior?
The full statement to be output in statement.
What is the actual behavior?
statement is just aggregate.
Additional context
It looks like the problem is that the method that populates statement (here) only appends the full statement when the command is one of the types in this mapping.
I'm mostly interested in getting full statements for aggregate and findAndModify commands, but there may be others as well.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working