Skip to content

pymongo is not collecting the property: db.mongodb.collection #1539

@avzis

Description

@avzis

According to the specs -
mongodb should capture: "The collection being accessed within the database stated in db.name."
and save it in: db.mongodb.collection

Steps to reproduce
Instrument a client using PymongoInstrumentor().
Send a request to the db.

What is the expected behavior?
Produce a span with db.mongodb.collection value containing the collection name.

What is the actual behavior?
Produce a span without generating db.mongodb.collection.

Example:
Here is a simple code example:

PymongoInstrumentor().instrument()
client = MongoClient()
RECORD = {"test": "123"}
db = client["MongoDB_Database"]
collection = db["MongoDB_Collection"]
collection.find_one(RECORD)

and the result is missing the collection:

"attributes": {
        "db.system": "mongodb",
        "db.name": "MongoDB_Database",
        "db.statement": "find",
        "net.peer.name": "localhost",
        "net.peer.port": 27017
    }

If you can - assign this to me, thanks :)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions