[SERVER-20997] Correlation facility for tracing Created: 18/Oct/15  Updated: 20/Oct/15  Resolved: 20/Oct/15

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Trivial - P5
Reporter: Aristarkh Zagorodnikov Assignee: Stennie Steneker (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Is there some kind of correlation facility for tracing, so some kind of end-to-end tracing analysis could be performed with MongoDB logs?
What I'm talking about is the ability to pass an arbitrary string with every request (think X-Request-Id in terms of HTTP) that gets logged whenever anything associated with this request is processed (error happens, timeout is exceeded, request is recorded to a profiling collection if it's enabled, etc.). I understand that post-processing correlation can be done by tracing used connection IDs on the client side, but this is hard to automate and requires more logging on the database client side.
This is marked as a question, not an improvement, because I'm not sure I'm not overlooking something obvious.



 Comments   
Comment by Aristarkh Zagorodnikov [ 20/Oct/15 ]

Thank you very much, Stephen, that was exactly what I was looking for!

Comment by Stennie Steneker (Inactive) [ 20/Oct/15 ]

Hi Aristarkh,

There is already a $comment meta-operator you can use to attach a comment to any expression taking a query predicate. This includes the query predicate in a db.collection.find(), db.collection.update(), or in the $match stage of an aggregation pipeline. The comment will appear in the profile collection and mongod logs depending on your logging configuration (profiling and log verbosity).

Would this address your use case, or can you provide some more specific examples?

Thanks,
Stephen

Generated at Thu Feb 08 03:55:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.