-
Notifications
You must be signed in to change notification settings - Fork 98
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
New configuration for globally controlled label value sizes #415
New configuration for globally controlled label value sizes #415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ comment.
src/span-data.js
Outdated
@@ -71,7 +78,7 @@ function SpanData(agent, trace, name, parentSpanId, isRoot, skipFrames) { | |||
callSite.getFileName(), callSite.getLineNumber(), | |||
callSite.getColumnNumber())); | |||
}); | |||
this.span.setLabel(TraceLabels.STACK_TRACE_DETAILS_KEY, | |||
this.addLabel(TraceLabels.STACK_TRACE_DETAILS_KEY, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be good to add a test to ensure that stack traces are not truncated.
Done. |
databaseResultReportingSize: 127, | ||
// The maximum number of characters reported on a label value. This | ||
// cannot exceed 16383, the maximum value accepted by the service. | ||
maximumLabelValueSize: 512, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/span-data.js
Outdated
@@ -92,7 +97,10 @@ SpanData.prototype.createChildSpanData = function(name, skipFrames) { | |||
}; | |||
|
|||
SpanData.prototype.addLabel = function(key, value) { | |||
this.span.setLabel(key, value); | |||
key = traceUtil.truncate(key, constants.TRACE_SERVICE_LABEL_KEY_LIMIT); | |||
var val = typeof value === 'object' ? util.inspect(value) : '' + value; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/span-data.js
Outdated
@@ -72,7 +76,8 @@ function SpanData(agent, trace, name, parentSpanId, isRoot, skipFrames) { | |||
callSite.getColumnNumber())); | |||
}); | |||
this.span.setLabel(TraceLabels.STACK_TRACE_DETAILS_KEY, | |||
JSON.stringify({stack_frame: stackFrames})); | |||
traceUtil.truncate(JSON.stringify({stack_frame: stackFrames}), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/test-util.js
Outdated
}); | ||
|
||
it('should not truncate objects smaller than size', function() { | ||
assert.equal(util.stringifyPrefix(o, 150), | ||
'{a:5,b:hi,c:[Function],d:{e:{f:null,g:undefined,h:{0:1,1:2}}}}'); | ||
assert.equal(util.truncate('abcdefghijklmno', 50), 'abcdefghijklmno'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.