From c5eb2c7f03fa01e4c7c4d6dc5de24b5a39c4fe19 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 23 Mar 2020 17:25:02 -0700 Subject: [PATCH] Update proto to the latest commit (#1040) Signed-off-by: Bogdan Drutu --- .../exporters/otlp/MetricAdapter.java | 12 ++--- .../exporters/otlp/SpanAdapter.java | 6 +-- .../exporters/otlp/MetricAdapterTest.java | 44 +++++++++---------- .../exporters/otlp/SpanAdapterTest.java | 10 ++--- proto/src/main/proto | 2 +- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/MetricAdapter.java b/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/MetricAdapter.java index 0ac1482853..96a67d443d 100644 --- a/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/MetricAdapter.java +++ b/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/MetricAdapter.java @@ -139,8 +139,8 @@ final class MetricAdapter { LongPoint longPoint = (LongPoint) point; Int64DataPoint.Builder builder = Int64DataPoint.newBuilder() - .setStartTimeUnixnano(longPoint.getStartEpochNanos()) - .setTimestampUnixnano(longPoint.getEpochNanos()) + .setStartTimeUnixNano(longPoint.getStartEpochNanos()) + .setTimeUnixNano(longPoint.getEpochNanos()) .setValue(longPoint.getValue()); // Not calling directly addAllLabels because that generates couple of unnecessary allocations. Collection labels = toProtoLabels(longPoint.getLabels()); @@ -158,8 +158,8 @@ final class MetricAdapter { DoublePoint doublePoint = (DoublePoint) point; DoubleDataPoint.Builder builder = DoubleDataPoint.newBuilder() - .setStartTimeUnixnano(doublePoint.getStartEpochNanos()) - .setTimestampUnixnano(doublePoint.getEpochNanos()) + .setStartTimeUnixNano(doublePoint.getStartEpochNanos()) + .setTimeUnixNano(doublePoint.getEpochNanos()) .setValue(doublePoint.getValue()); // Not calling directly addAllLabels because that generates couple of unnecessary allocations. Collection labels = toProtoLabels(doublePoint.getLabels()); @@ -177,8 +177,8 @@ final class MetricAdapter { SummaryPoint summaryPoint = (SummaryPoint) point; SummaryDataPoint.Builder builder = SummaryDataPoint.newBuilder() - .setStartTimeUnixnano(summaryPoint.getStartEpochNanos()) - .setTimestampUnixnano(summaryPoint.getEpochNanos()) + .setStartTimeUnixNano(summaryPoint.getStartEpochNanos()) + .setTimeUnixNano(summaryPoint.getEpochNanos()) .setCount(summaryPoint.getCount()) .setSum(summaryPoint.getSum()); // Not calling directly addAllLabels because that generates couple of unnecessary allocations diff --git a/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/SpanAdapter.java b/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/SpanAdapter.java index 44091edb70..d19b61b836 100644 --- a/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/SpanAdapter.java +++ b/exporters/otlp/src/main/java/io/opentelemetry/exporters/otlp/SpanAdapter.java @@ -91,8 +91,8 @@ final class SpanAdapter { builder.setParentSpanId(TraceProtoUtils.toProtoSpanId(spanData.getParentSpanId())); builder.setName(spanData.getName()); builder.setKind(toProtoSpanKind(spanData.getKind())); - builder.setStartTimeUnixnano(spanData.getStartEpochNanos()); - builder.setEndTimeUnixnano(spanData.getEndEpochNanos()); + builder.setStartTimeUnixNano(spanData.getStartEpochNanos()); + builder.setEndTimeUnixNano(spanData.getEndEpochNanos()); for (Map.Entry resourceEntry : spanData.getAttributes().entrySet()) { builder.addAttributes( CommonAdapter.toProtoAttribute(resourceEntry.getKey(), resourceEntry.getValue())); @@ -131,7 +131,7 @@ final class SpanAdapter { static Span.Event toProtoSpanEvent(TimedEvent timedEvent) { Span.Event.Builder builder = Span.Event.newBuilder(); builder.setName(timedEvent.getName()); - builder.setTimeUnixnano(timedEvent.getEpochNanos()); + builder.setTimeUnixNano(timedEvent.getEpochNanos()); for (Map.Entry resourceEntry : timedEvent.getAttributes().entrySet()) { builder.addAttributes( CommonAdapter.toProtoAttribute(resourceEntry.getKey(), resourceEntry.getValue())); diff --git a/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/MetricAdapterTest.java b/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/MetricAdapterTest.java index ccb02586b8..299972ce03 100644 --- a/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/MetricAdapterTest.java +++ b/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/MetricAdapterTest.java @@ -102,8 +102,8 @@ public class MetricAdapterTest { MetricData.LongPoint.create(123, 456, Collections.singletonMap("k", "v"), 5)))) .containsExactly( Int64DataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -117,13 +117,13 @@ public class MetricAdapterTest { MetricData.LongPoint.create(321, 654, Collections.singletonMap("k", "v"), 7)))) .containsExactly( Int64DataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .setValue(5) .build(), Int64DataPoint.newBuilder() - .setStartTimeUnixnano(321) - .setTimestampUnixnano(654) + .setStartTimeUnixNano(321) + .setTimeUnixNano(654) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -142,8 +142,8 @@ public class MetricAdapterTest { 123, 456, Collections.singletonMap("k", "v"), 5.1)))) .containsExactly( DoubleDataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -158,13 +158,13 @@ public class MetricAdapterTest { 321, 654, Collections.singletonMap("k", "v"), 7.1)))) .containsExactly( DoubleDataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .setValue(5.1) .build(), DoubleDataPoint.newBuilder() - .setStartTimeUnixnano(321) - .setTimestampUnixnano(654) + .setStartTimeUnixNano(321) + .setTimeUnixNano(654) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -188,8 +188,8 @@ public class MetricAdapterTest { Collections.singletonList(MetricData.ValueAtPercentile.create(0.9, 1.1)))))) .containsExactly( SummaryDataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -220,14 +220,14 @@ public class MetricAdapterTest { MetricData.ValueAtPercentile.create(0.99, 20.3)))))) .containsExactly( SummaryDataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .setCount(7) .setSum(15.3) .build(), SummaryDataPoint.newBuilder() - .setStartTimeUnixnano(321) - .setTimestampUnixnano(654) + .setStartTimeUnixNano(321) + .setTimeUnixNano(654) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -308,8 +308,8 @@ public class MetricAdapterTest { .addAllInt64DataPoints( Collections.singletonList( Int64DataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) @@ -345,8 +345,8 @@ public class MetricAdapterTest { .addAllDoubleDataPoints( Collections.singletonList( DoubleDataPoint.newBuilder() - .setStartTimeUnixnano(123) - .setTimestampUnixnano(456) + .setStartTimeUnixNano(123) + .setTimeUnixNano(456) .addAllLabels( Collections.singletonList( StringKeyValue.newBuilder().setKey("k").setValue("v").build())) diff --git a/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/SpanAdapterTest.java b/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/SpanAdapterTest.java index e2f8a56606..08709a7f90 100644 --- a/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/SpanAdapterTest.java +++ b/exporters/otlp/src/test/java/io/opentelemetry/exporters/otlp/SpanAdapterTest.java @@ -84,8 +84,8 @@ public class SpanAdapterTest { assertThat(span.getParentSpanId().toByteArray()).isEqualTo(new byte[] {0, 0, 0, 0, 0, 0, 0, 0}); assertThat(span.getName()).isEqualTo("GET /api/endpoint"); assertThat(span.getKind()).isEqualTo(SpanKind.SERVER); - assertThat(span.getStartTimeUnixnano()).isEqualTo(12345); - assertThat(span.getEndTimeUnixnano()).isEqualTo(12349); + assertThat(span.getStartTimeUnixNano()).isEqualTo(12345); + assertThat(span.getEndTimeUnixNano()).isEqualTo(12349); assertThat(span.getAttributesList()) .containsExactly( AttributeKeyValue.newBuilder() @@ -96,7 +96,7 @@ public class SpanAdapterTest { assertThat(span.getDroppedAttributesCount()).isEqualTo(1); assertThat(span.getEventsList()) .containsExactly( - Span.Event.newBuilder().setTimeUnixnano(12347).setName("my_event").build()); + Span.Event.newBuilder().setTimeUnixNano(12347).setName("my_event").build()); assertThat(span.getDroppedEventsCount()).isEqualTo(2); // 3 - 1 assertThat(span.getLinksList()) .containsExactly( @@ -240,7 +240,7 @@ public class SpanAdapterTest { Collections.emptyMap()))) .isEqualTo( Span.Event.newBuilder() - .setTimeUnixnano(12345) + .setTimeUnixNano(12345) .setName("test_without_attributes") .build()); } @@ -257,7 +257,7 @@ public class SpanAdapterTest { 5))) .isEqualTo( Span.Event.newBuilder() - .setTimeUnixnano(12345) + .setTimeUnixNano(12345) .setName("test_with_attributes") .addAttributes( AttributeKeyValue.newBuilder() diff --git a/proto/src/main/proto b/proto/src/main/proto index 425bcf2ec8..6a4eb2fa6f 160000 --- a/proto/src/main/proto +++ b/proto/src/main/proto @@ -1 +1 @@ -Subproject commit 425bcf2ec82b1792498ce382054b10f3551523b2 +Subproject commit 6a4eb2fa6f25569910f7b17216e3a2087496bbce