-
Notifications
You must be signed in to change notification settings - Fork 117
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
Query Sanitization #769
Comments
@jclusso can you drop us more details at [email protected] and share the query you see and how you wish it should appear instead? |
@shairyar I feel the sanitization is not ideal. It's very hard to tell what your queries in a trace are for when everything is wiped out with question marks. We should sanitize the values of hashes so we can still see what is going on while maintaining the data privacy. Additionally, I think there should be options for this. I propse we introduce a new configuration option called Here is an example of the new way things could be sanitized. {
name: "Jarrett",
location: { state: "NY", country: "US" },
logins: [
{ date: "1/1/2021", location: { state: "NY", country: "US" },
{ date: "1/7/2021", location: { state: "NJ", country: "US" }
]
} should sanitize to {
name: "?",
location: { state: "?", country: "?" },
logins: [
{ date: "?", location: { state: "?", country: "?" },
{ date: "?", location: { state: "?", country: "?" }
]
} |
Thanks for reporting it, it's something we will be improving in the future. We will update this issue when progress has been made however there is no timeline available yet. |
@shairyar we may work on improving this ourselves. If we do I'll make a PR. If you have any details you think are important, let me know. |
Sure, feel free to ping us if you have any questions while you are working on it. |
@shairyar I've gotten started on some changes here. There will be two new configuration options, a boolean for RedisThis was easy to sort out. Since Redis doesn't really have query parameters, I figured it made the most sense to either sanitize all or nothing. There is a 1,000 character limit to prevent gigantic strings of data and arguments that would just clog things up. Mongo Ruby DriverI've reworked how the strategies work. The strategies now take into account the
Elasticsearch and MopedBoth of these use the updated QueryParamsSanitizer. Any improvements to that will be impacted here. Unlike the Mongo Ruby Driver I left Moped alone. I can't imagine Moped is heavily used anymore and didn't seem worth the effort to further improve. All of this can be seen so far here. Let me know what you think so far. |
I had a discussion about this with my colleague. We don't think we want to start adding |
As MongoDB/Elastic users ourselves I'd love to get more insight into the queries! We do have the issue that we use this sanitized body to group events together (in the slow query list and for event metrics). Ideally, the sanitized value would be the same no matter the query details for that specific query.
This would then probably have to be written such that it emits only the first item, to prevent us from detecting 11 more variants of this query. (1-11 items).
We added the key sanitizer because it's possible to dig into embedded documents with the We could also look into perhaps using different formatters for the display value vs the value we use to determine the uniqueness of queries. |
Honestly, for us this (combined with some other things) is pretty much a deal breaker at the moment. I'll leave this code as is for you guys to figure out since it seems it will require changes internally for anything like this to ever work. We'll be happy to try again in the future. |
I will remove bulk sanitization and do a few tests to see how it behaves in the app to make a decision. |
Hi @jclusso! The sanitization is now way less restrictive in the last version (3.0.21). |
@luismiramirez that's great to hear! Any plans on the Redis queries? |
@luismiramirez was testing you guys out again and noticed you still don't output anything at all for aggregations. Is there any plans to add support for that? |
@jclusso Hi there! We've been focused on the Python integration and other stuff during this time. I'll bring this to the team to see if we can tackle it soon. I will let you know as soon as we start working on it! |
Is there a reason all database queries for MongoDB and Redis are wiped out with a ?. This makes it hard to trace the query if you don't know anything about it. When comparing to Elastic APM I can see the entire query for a traced transaction.
The text was updated successfully, but these errors were encountered: