Skip to content
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

Limit span names/labels to service limits #345

Merged
merged 1 commit into from
Jan 14, 2017
Merged

Limit span names/labels to service limits #345

merged 1 commit into from
Jan 14, 2017

Conversation

matthewloring
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 13, 2017
@matthewloring
Copy link
Contributor Author

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.

@matthewloring matthewloring changed the title Limit label values to 5000 characters Limit span names/labels to service limits Jan 13, 2017
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.

/**
* Creates a trace span object.
* @constructor
*/
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.

@@ -37,7 +43,14 @@ function TraceSpan(name, spanId, parentSpanId) {
* @param {string} value The new value of the label.
*/
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.

@@ -17,13 +17,26 @@
'use strict';

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.

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.

@matthewloring matthewloring merged commit 94e5dad into googleapis:master Jan 14, 2017
@matthewloring matthewloring deleted the label-size branch January 14, 2017 02:08
vmarchaud pushed a commit to keymetrics/origa that referenced this pull request Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants