Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Limit span names/labels to service limits - #345

Merged
matthewloring merged 1 commit into
googleapis:masterfrom
matthewloring:label-size
Jan 14, 2017
Merged

matthewloring merged 1 commit into
googleapis:masterfrom
matthewloring:label-size

Conversation

@matthewloring

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

PTAL.

Comment thread src/trace-span.js Outdated
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
Comment thread src/constants.js Outdated
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.

Comment thread src/trace-span.js Outdated
*/
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.

Comment thread src/trace-span.js Outdated
*/
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.

Comment thread src/trace-span.js
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.

Comment thread src/constants.js
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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