/** * * * <pre> * A set of attributes on the span. You can have up to 32 attributes per * span. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code> */ public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() { return getAttributes(); }
output.writeMessage(7, getAttributes());
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAttributes());
hash = (53 * hash) + getAttributes().hashCode();
result = result && getAttributes().equals(other.getAttributes());
mergeAttributes(other.getAttributes());
/** * * * <pre> * A set of attributes on the span. You can have up to 32 attributes per * span. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;</code> */ public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() { return getAttributes(); }
output.writeMessage(7, getAttributes());
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAttributes());
@Test public void generateSpan_WithResourceLabels() { SpanData spanData = SpanData.create( spanContext, parentSpanId, /* hasRemoteParent= */ true, SPAN_NAME, null, startTimestamp, attributes, annotations, messageEvents, links, CHILD_SPAN_COUNT, status, endTimestamp); Span span = handler.generateSpan( spanData, AWS_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()); Map<String, AttributeValue> attributeMap = span.getAttributes().getAttributeMapMap(); assertThat(attributeMap.entrySet()).containsAllIn(AWS_RESOURCE_LABELS.entrySet()); }
handler.generateSpan( spanData, EMPTY_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()); Map<String, AttributeValue> attributes = span.getAttributes().getAttributeMapMap();
Map<String, AttributeValue> attributeMap = span.getAttributes().getAttributeMapMap(); assertThat(attributeMap.entrySet()).containsAllIn(fixedAttributes.entrySet());
hash = (53 * hash) + getAttributes().hashCode();
result = result && getAttributes().equals(other.getAttributes());
mergeAttributes(other.getAttributes());
assertThat(span.getStartTime()).isEqualTo(startTime); assertThat(span.getEndTime()).isEqualTo(endTime); assertThat(span.getAttributes().getDroppedAttributesCount()) .isEqualTo(DROPPED_ATTRIBUTES_COUNT); assertThat(span.getAttributes().getAttributeMapMap()) .containsEntry(ATTRIBUTE_KEY_1, AttributeValue.newBuilder().setIntValue(10L).build()); assertThat(span.getAttributes().getAttributeMapMap()) .containsEntry(ATTRIBUTE_KEY_2, AttributeValue.newBuilder().setBoolValue(true).build());