private StackdriverV2ExporterHandler( String projectId, TraceServiceClient traceServiceClient, @javax.annotation.Nullable Map<String, io.opencensus.trace.AttributeValue> fixedAttributes) { this.projectId = checkNotNull(projectId, "projectId"); this.traceServiceClient = traceServiceClient; if (fixedAttributes == null) { this.fixedAttributes = Collections.emptyMap(); } else { this.fixedAttributes = new HashMap<>(); for (Map.Entry<String, io.opencensus.trace.AttributeValue> label : fixedAttributes.entrySet()) { AttributeValue value = toAttributeValueProto(label.getValue()); if (value != null) { this.fixedAttributes.put(label.getKey(), value); } } } projectName = ProjectName.of(this.projectId); }
private StackdriverV2ExporterHandler( String projectId, TraceServiceClient traceServiceClient, @javax.annotation.Nullable Map<String, io.opencensus.trace.AttributeValue> fixedAttributes) { this.projectId = checkNotNull(projectId, "projectId"); this.traceServiceClient = traceServiceClient; if (fixedAttributes == null) { this.fixedAttributes = Collections.emptyMap(); } else { this.fixedAttributes = new HashMap<>(); for (Map.Entry<String, io.opencensus.trace.AttributeValue> label : fixedAttributes.entrySet()) { AttributeValue value = toAttributeValueProto(label.getValue()); if (value != null) { this.fixedAttributes.put(label.getKey(), value); } } } projectName = ProjectName.of(this.projectId); }
private static Attributes.Builder toAttributesBuilderProto( Map<String, io.opencensus.trace.AttributeValue> attributes, int droppedAttributesCount) { Attributes.Builder attributesBuilder = Attributes.newBuilder().setDroppedAttributesCount(droppedAttributesCount); for (Map.Entry<String, io.opencensus.trace.AttributeValue> label : attributes.entrySet()) { AttributeValue value = toAttributeValueProto(label.getValue()); if (value != null) { attributesBuilder.putAttributeMap(mapKey(label.getKey()), value); } } return attributesBuilder; }
private static Attributes.Builder toAttributesBuilderProto( Map<String, io.opencensus.trace.AttributeValue> attributes, int droppedAttributesCount) { Attributes.Builder attributesBuilder = Attributes.newBuilder().setDroppedAttributesCount(droppedAttributesCount); for (Map.Entry<String, io.opencensus.trace.AttributeValue> label : attributes.entrySet()) { AttributeValue value = toAttributeValueProto(label.getValue()); if (value != null) { attributesBuilder.putAttributeMap(mapKey(label.getKey()), value); } } return attributesBuilder; }