diff --git a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/HaystackExporterHandler.java b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/HaystackExporterHandler.java similarity index 99% rename from integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/HaystackExporterHandler.java rename to integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/HaystackExporterHandler.java index 5c38ad9..2abe3d7 100644 --- a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/HaystackExporterHandler.java +++ b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/HaystackExporterHandler.java @@ -15,7 +15,7 @@ * */ -package com.www.expedia.opencensus.exporter.trace; +package com.expedia.www.opencensus.exporter.trace; import com.expedia.open.tracing.Log; import com.expedia.open.tracing.Tag; diff --git a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/HaystackTraceExporter.java b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/HaystackTraceExporter.java similarity index 94% rename from integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/HaystackTraceExporter.java rename to integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/HaystackTraceExporter.java index 04e2a57..05df610 100644 --- a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/HaystackTraceExporter.java +++ b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/HaystackTraceExporter.java @@ -15,7 +15,7 @@ * */ -package com.www.expedia.opencensus.exporter.trace; +package com.expedia.www.opencensus.exporter.trace; import com.expedia.open.tracing.Span; import com.expedia.www.haystack.client.dispatchers.clients.Client; @@ -23,9 +23,9 @@ import com.expedia.www.haystack.client.dispatchers.clients.HttpCollectorProtoClient; import com.expedia.www.haystack.client.metrics.Metrics; import com.expedia.www.haystack.client.metrics.NoopMetricsRegistry; -import com.www.expedia.opencensus.exporter.trace.config.DispatcherConfig; -import com.www.expedia.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig; -import com.www.expedia.opencensus.exporter.trace.config.HttpDispatcherConfig; +import com.expedia.www.opencensus.exporter.trace.config.DispatcherConfig; +import com.expedia.www.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig; +import com.expedia.www.opencensus.exporter.trace.config.HttpDispatcherConfig; import io.opencensus.trace.Tracing; import io.opencensus.trace.export.SpanExporter; diff --git a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/DispatcherConfig.java b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/DispatcherConfig.java similarity index 95% rename from integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/DispatcherConfig.java rename to integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/DispatcherConfig.java index 1f4e90c..d0f235b 100644 --- a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/DispatcherConfig.java +++ b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/DispatcherConfig.java @@ -15,7 +15,7 @@ * */ -package com.www.expedia.opencensus.exporter.trace.config; +package com.expedia.www.opencensus.exporter.trace.config; import org.apache.commons.lang3.Validate; diff --git a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/GrpcAgentDispatcherConfig.java b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/GrpcAgentDispatcherConfig.java similarity index 96% rename from integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/GrpcAgentDispatcherConfig.java rename to integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/GrpcAgentDispatcherConfig.java index 47fe8d1..982fa02 100644 --- a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/GrpcAgentDispatcherConfig.java +++ b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/GrpcAgentDispatcherConfig.java @@ -15,7 +15,7 @@ * */ -package com.www.expedia.opencensus.exporter.trace.config; +package com.expedia.www.opencensus.exporter.trace.config; import org.apache.commons.lang3.Validate; diff --git a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/HttpDispatcherConfig.java b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/HttpDispatcherConfig.java similarity index 96% rename from integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/HttpDispatcherConfig.java rename to integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/HttpDispatcherConfig.java index 87dd758..c86265d 100644 --- a/integrations/opencensus/src/main/java/com/www/expedia/opencensus/exporter/trace/config/HttpDispatcherConfig.java +++ b/integrations/opencensus/src/main/java/com/expedia/www/opencensus/exporter/trace/config/HttpDispatcherConfig.java @@ -15,7 +15,7 @@ * */ -package com.www.expedia.opencensus.exporter.trace.config; +package com.expedia.www.opencensus.exporter.trace.config; import org.apache.commons.lang3.Validate; diff --git a/integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterHandlerSpec.scala b/integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackExporterHandlerSpec.scala similarity index 99% rename from integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterHandlerSpec.scala rename to integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackExporterHandlerSpec.scala index 608b008..78f8abd 100644 --- a/integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterHandlerSpec.scala +++ b/integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackExporterHandlerSpec.scala @@ -15,8 +15,7 @@ * */ -package com.www.expedia.opencensus.exporter.trace - +package com.expedia.www.opencensus.exporter.trace import java.util.Collections @@ -29,6 +28,7 @@ import io.opencensus.trace.{MessageEvent, Tracestate, _} import org.easymock.EasyMock import org.scalatest._ import org.scalatest.easymock.EasyMockSugar + import scala.collection.JavaConverters._ class HaystackExporterHandlerSpec extends FunSpec with GivenWhenThen with Matchers with EasyMockSugar { diff --git a/integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala b/integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala similarity index 88% rename from integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala rename to integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala index 59c7ffa..1159978 100644 --- a/integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala +++ b/integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackExporterIntegrationSpec.scala @@ -15,17 +15,14 @@ * */ -package com.www.expedia.opencensus.exporter.trace +package com.expedia.www.opencensus.exporter.trace - -import java.util import java.util.{Collections, Random} -import com.www.expedia.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig +import com.expedia.www.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig import io.opencensus.trace._ import io.opencensus.trace.samplers.Samplers -import org.apache.kafka.clients.consumer.ConsumerConfig._ -import org.apache.kafka.clients.consumer.KafkaConsumer +import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer} import org.apache.kafka.common.serialization.{ByteArrayDeserializer, StringDeserializer} import org.scalatest.{BeforeAndAfterAll, FunSpec, GivenWhenThen, Matchers} @@ -34,16 +31,15 @@ import scala.collection.JavaConverters._ class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Matchers with BeforeAndAfterAll { private val OPERATION_NAME = "/search" private val SERVICE_NAME = "my-service" - private val START_TIME_MICROS = System.currentTimeMillis() * 1000 private val MAX_DURATION_MILLIS = 10 private var consumer: KafkaConsumer[String, Array[Byte]] = _ override def beforeAll(): Unit = { Thread.sleep(20000) - val config: java.util.Map[String, Object] = new util.HashMap() - config.put(BOOTSTRAP_SERVERS_CONFIG, "kafkasvc:9092") - config.put(GROUP_ID_CONFIG, "integration_test") - config.put(AUTO_OFFSET_RESET_CONFIG, "earliest") + val config: java.util.Map[String, Object] = new java.util.HashMap() + config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafkasvc:9092") + config.put(ConsumerConfig.GROUP_ID_CONFIG, "integration_test") + config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest") consumer = new KafkaConsumer(config, new StringDeserializer(), new ByteArrayDeserializer()) consumer.subscribe(Collections.singleton("proto-spans")) } @@ -70,6 +66,7 @@ class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Ma tracer.getCurrentSpan.putAttribute("error", AttributeValue.booleanAttributeValue(true)) tracer.getCurrentSpan.addAnnotation("done searching", Collections.singletonMap("someevent", AttributeValue.longAttributeValue(200))) + } catch { case _: Exception => tracer.getCurrentSpan.addAnnotation("Exception thrown when processing!") @@ -102,7 +99,6 @@ class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Ma protoSpan.getTraceId shouldEqual record.key() protoSpan.getServiceName shouldEqual SERVICE_NAME protoSpan.getOperationName shouldEqual OPERATION_NAME - protoSpan.getStartTime should be >= START_TIME_MICROS protoSpan.getTagsCount shouldBe 5 protoSpan.getTagsList.asScala.find(_.getKey == "span.kind").get.getVStr shouldEqual "server" protoSpan.getTagsList.asScala.find(_.getKey == "foo").get.getVStr shouldEqual "bar" diff --git a/integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackTraceExporterSpec.scala b/integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackTraceExporterSpec.scala similarity index 94% rename from integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackTraceExporterSpec.scala rename to integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackTraceExporterSpec.scala index f6ca7f4..03a3299 100644 --- a/integrations/opencensus/src/test/scala/com/www/expedia/opencensus/exporter/trace/HaystackTraceExporterSpec.scala +++ b/integrations/opencensus/src/test/scala/com/expedia/www/opencensus/exporter/trace/HaystackTraceExporterSpec.scala @@ -15,9 +15,9 @@ * */ -package com.www.expedia.opencensus.exporter.trace +package com.expedia.www.opencensus.exporter.trace -import com.www.expedia.opencensus.exporter.trace.config.{GrpcAgentDispatcherConfig, HttpDispatcherConfig} +import com.expedia.www.opencensus.exporter.trace.config.{GrpcAgentDispatcherConfig, HttpDispatcherConfig} import org.scalatest.{FunSpec, GivenWhenThen, Matchers} class HaystackTraceExporterSpec extends FunSpec with GivenWhenThen with Matchers {