Merge pull request #29117 from overleaf/jpa-clsi-logging
[clsi] log high level details for large clsi-cache requests GitOrigin-RevId: e368d745554c925a665f8794514cc8bfed78b7b3
This commit is contained in:
@@ -62,10 +62,8 @@ function notifyCLSICacheAboutBuild({
|
||||
* @param {[{path: string}]} files
|
||||
*/
|
||||
const enqueue = files => {
|
||||
Metrics.count('clsi_cache_enqueue_files', files.length)
|
||||
fetchNothing(`${url}/enqueue`, {
|
||||
method: 'POST',
|
||||
json: {
|
||||
const body = Buffer.from(
|
||||
JSON.stringify({
|
||||
projectId,
|
||||
userId,
|
||||
buildId,
|
||||
@@ -75,7 +73,29 @@ function notifyCLSICacheAboutBuild({
|
||||
clsiServerId: Settings.apis.clsi.clsiServerId,
|
||||
compileGroup,
|
||||
options,
|
||||
},
|
||||
})
|
||||
)
|
||||
const bodySize = body.byteLength
|
||||
if (bodySize > 10_000_000) {
|
||||
const outputPDF = files.find(f => f.path === 'output.pdf')
|
||||
logger.warn(
|
||||
{
|
||||
projectId,
|
||||
userId,
|
||||
bodySize,
|
||||
nFiles: files.length,
|
||||
outputPDFSize:
|
||||
outputPDF && Buffer.from(JSON.stringify(outputPDF)).byteLength,
|
||||
nPDFCachingRanges: outputPDF?.ranges?.length,
|
||||
},
|
||||
'large clsi-cache request'
|
||||
)
|
||||
}
|
||||
Metrics.count('clsi_cache_enqueue_files', files.length)
|
||||
fetchNothing(`${url}/enqueue`, {
|
||||
method: 'POST',
|
||||
body,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
signal: AbortSignal.timeout(15_000),
|
||||
}).catch(err => {
|
||||
logger.warn(
|
||||
|
||||
Reference in New Issue
Block a user