Skip to content

Commit

Permalink
fix: improve error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Jan 19, 2024
1 parent 3ac5c4c commit 1348969
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/db/throttler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const axiosError = async (err) => {
err.response.data.on('data', data => { err.responseData += data })
await new Promise((resolve) => err.response.data.once('end', resolve))
}
return err
if (typeof resp.data === 'string') {
err.responseData = resp.data
}
return new Error('AXIOS ERROR: ' + err +
(err.responseData ? ' Response data: ' + err.responseData : ''))
}
} catch (e) {
return err
Expand Down Expand Up @@ -64,7 +68,7 @@ class TimeoutThrottler {
}

const samplesThrottler = new TimeoutThrottler(
`INSERT INTO ${clickhouseOptions.queryOptions.database}.${samplesTableName}${dist}(fingerprint, timestamp_ns, value, string) FORMAT JSONEachRow`)
`INSERT INTO ${clickhouseOptions.queryOptions.database}.${samplesTableName}${dist}(fingerprint, timestamp_ns, value, string) FORMAT JSONEachRow2`)
const timeSeriesThrottler = new TimeoutThrottler(
`INSERT INTO ${clickhouseOptions.queryOptions.database}.time_series${dist}(date, fingerprint, labels, name) FORMAT JSONEachRow`)
const tracesThottler = new TimeoutThrottler(
Expand Down

0 comments on commit 1348969

Please sign in to comment.