Repository navigation
Limit span names/labels to service limits - #345
Conversation
|
PTAL. |
| var val = '' + value; | ||
| // The official limit imposed by the service is 16k per label value. | ||
| // We truncate smaller than that to keep requests small. | ||
| if (val.length > 5000) { |
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.
| TRACE_SERVICE_LABEL_KEY_LIMIT: 128, | ||
|
|
||
| /** Maximum size of a label value in bytes. */ | ||
| TRACE_SERVICE_LABEL_VALUE_LIMIT: 16 * 1000, |
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.
| */ | ||
| function TraceSpan(name, spanId, parentSpanId) { | ||
| this.name = name; | ||
| if (name.length > constants.TRACE_SERVICE_SPAN_NAME_LIMIT) { |
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.
| */ | ||
| TraceSpan.prototype.setLabel = function(key, value) { | ||
| this.labels[key] = '' + value; | ||
| if (key.length > constants.TRACE_SERVICE_LABEL_KEY_LIMIT) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| var util = require('util'); | ||
| var constants = require('./constants.js'); | ||
|
|
||
| function truncate(string, length) { |
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.
| TRACE_OPTIONS_TRACE_ENABLED: 1 << 0, | ||
|
|
||
| /** See: cloud.google.com/trace/api/reference/rest/v1/projects.traces for limits. */ | ||
| /** Maximum size of a span name in bytes. */ |
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.