Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
avzis opened this issue Dec 26, 2022 · 0 comments · Fixed by #1555
Closed

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

avzis opened this issue Dec 26, 2022 · 0 comments · Fixed by #1555
Assignees
Labels
bug Something isn't working

Comments

@avzis
Copy link
Contributor

avzis commented Dec 26, 2022

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 :)

@avzis avzis added the bug Something isn't working label Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant