elastic-apm-http-client
Advanced tools
Comparing version 9.0.0 to 9.1.0
@@ -129,2 +129,3 @@ 'use strict' | ||
if (!this._conf.truncateStringsAt) this._conf.truncateStringsAt = 1024 | ||
if (!this._conf.truncateCustomKeysAt) this._conf.truncateCustomKeysAt = 1024 | ||
if (!this._conf.truncateQueriesAt) this._conf.truncateQueriesAt = 10000 | ||
@@ -131,0 +132,0 @@ if (!this._conf.bufferWindowTime) this._conf.bufferWindowTime = 20 |
@@ -106,3 +106,3 @@ 'use strict' | ||
function truncSpan (span, opts) { | ||
const result = breadthFilter(span, { | ||
let result = breadthFilter(span, { | ||
onArray, | ||
@@ -137,2 +137,18 @@ onObject, | ||
result = truncateCustomKeys( | ||
result, | ||
opts.truncateCustomKeysAt, | ||
[ | ||
'name', | ||
'type', | ||
'id', | ||
'trace_id', | ||
'parent_id', | ||
'transaction_id', | ||
'subtype', | ||
'action', | ||
'context' | ||
] | ||
) | ||
return Object.assign({ | ||
@@ -289,1 +305,18 @@ name: 'undefined', | ||
} | ||
function truncateCustomKeys (value, max, keywords) { | ||
if (typeof value !== 'object') { | ||
return value | ||
} | ||
const result = value | ||
const keys = Object.keys(result) | ||
const truncatedKeys = keys.map(k => keywords.includes(k) ? k : truncate(k, max)) | ||
for (const [index, k] of keys.entries()) { | ||
const value = result[k] | ||
delete result[k] | ||
const newKey = truncatedKeys[index] | ||
result[newKey] = truncateCustomKeys(value, max, keywords) | ||
} | ||
return result | ||
} |
{ | ||
"name": "elastic-apm-http-client", | ||
"version": "9.0.0", | ||
"version": "9.1.0", | ||
"description": "A low-level HTTP client for communicating with the Elastic APM intake API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43669
908