Logging SQL Strings from Production

86 views
Skip to first unread message

Tommy C. Li

unread,
Jun 28, 2022, 2:00:38 PM6/28/22
to Chromium-dev, Austin Sullivan, Sophie Chang
Hello,

Is there a recommended way to log strings from production error cases?

Specifically, sometimes we get SQLITE_ERROR in Chromium, and we want to learn which is the problematic SQL query.

We _could_ try to enumerate all the queries and log them to a UMA histogram, but there's a lot of queries and I suspect it's a unknown or obscure query that's causing the issue.

The best thing I can think of is adding a CrashKeyString and calling base::debug::DumpWithoutCrashing() when this error condition occurs.

But is there a better way?

Related question: is there a canonical way to downsample so I don't generate a million crash reports?

Thanks,

Tommy

Giovanni Ortuño

unread,
Jun 28, 2022, 9:31:15 PM6/28/22
to Tommy Li, Christopher Lam, Chromium-dev, Austin Sullivan, Sophie Chang
I believe +Christopher Lam  did something similar recently that avoided DumpWithoutCrashing().

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/de3c2cf4-96f3-4288-b4aa-c2a8bf784c26n%40chromium.org.

Christopher Lam

unread,
Jun 30, 2022, 2:20:14 AM6/30/22
to Giovanni Ortuño, Tommy Li, Chromium-dev, Austin Sullivan, Sophie Chang
I used Chrometto which was kind of neat. Basically you can use TRACE_EVENT to send exactly what you need (incl a String), and fire a UMA event to initiate collection on the server side. It was described to me as UMA with stack traces.

CL is here. Docs are here.
Reply all
Reply to author
Forward
0 new messages